Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.34 KB

File metadata and controls

55 lines (39 loc) · 1.34 KB

Examples

Runnable examples for Valkey GLIDE Ruby. Requires a Valkey or Redis OSS server unless noted.

Prerequisites

From the repository root:

bin/setup

Run examples with the gem loaded from lib/:

bundle exec ruby examples/standalone.rb

Or:

RUBYOPT="-I$(pwd)/lib" ruby examples/standalone.rb

Examples

File Description Server
standalone.rb Basic connect, SET, GET Standalone :6379
cluster.rb Cluster connect, SET, GET Cluster :7000:7005
pipelining.rb Non-atomic pipeline Standalone :6379
opentelemetry.rb OTel file exporter + traced commands Standalone :6379
statistics.rb Client statistics Standalone :6379

Environment variables

Variable Default Purpose
VALKEY_HOST 127.0.0.1 Server host
VALKEY_PORT 6379 Standalone port
VALKEY_CLUSTER_PORT 7000 First cluster node port

Standalone with Docker

docker run -d --name valkey -p 6379:6379 valkey/valkey:8
bundle exec ruby examples/standalone.rb

Cluster with Docker

docker run -d -p 7000-7005:7000-7005 grokzen/redis-cluster:7.0.15
bundle exec ruby examples/cluster.rb