Sha256: b21a55a79bee46c0734f921f0cf36d3fb4b2b22779d56d159b60189daa9fe0d7

Contents?: true

Size: 809 Bytes

Versions: 102

Compression:

Stored size: 809 Bytes

Contents

require "redis"
require "redis/distributed"

r = Redis::Distributed.new %w[redis://localhost:6379 redis://localhost:6380 redis://localhost:6381 redis://localhost:6382]

r.flushdb

r['urmom'] = 'urmom'
r['urdad'] = 'urdad'
r['urmom1'] = 'urmom1'
r['urdad1'] = 'urdad1'
r['urmom2'] = 'urmom2'
r['urdad2'] = 'urdad2'
r['urmom3'] = 'urmom3'
r['urdad3'] = 'urdad3'
p r['urmom']
p r['urdad']
p r['urmom1']
p r['urdad1']
p r['urmom2']
p r['urdad2']
p r['urmom3']
p r['urdad3']

r.rpush 'listor', 'foo1'
r.rpush 'listor', 'foo2'
r.rpush 'listor', 'foo3'
r.rpush 'listor', 'foo4'
r.rpush 'listor', 'foo5'

p r.rpop('listor')
p r.rpop('listor')
p r.rpop('listor')
p r.rpop('listor')
p r.rpop('listor')

puts "key distribution:"

r.ring.nodes.each do |node|
  p [node.client, node.keys("*")]
end
r.flushdb
p r.keys('*')

Version data entries

102 entries across 100 versions & 16 rubygems

Version Path
classiccms-0.3.0 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
redis-3.0.0 examples/dist_redis.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/redis-2.2.2/examples/dist_redis.rb
redis-3.0.0.rc2 examples/dist_redis.rb
gorsuch-redis-3.0.0.rc1 examples/dist_redis.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/redis-2.2.2/examples/dist_redis.rb
redis-3.0.0.rc1 examples/dist_redis.rb
yam-redis-with-retries-2.2.2.1 examples/dist_redis.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/redis-2.2.2/examples/dist_redis.rb
redis-2.2.2 examples/dist_redis.rb
redis-2.2.1 examples/dist_redis.rb
modesty-0.1.0 vendor/redis-rb/examples/dist_redis.rb
redis-2.2.0 examples/dist_redis.rb
lunar-0.4.1 vendor/redis/examples/dist_redis.rb
lunar-0.4.0 vendor/redis/examples/dist_redis.rb
lunar-0.3.0 vendor/redis/examples/dist_redis.rb
lunar-0.2.3 vendor/redis/examples/dist_redis.rb
lunar-0.2.2 vendor/redis/examples/dist_redis.rb
lunar-0.2.1 vendor/redis/examples/dist_redis.rb
lunar-0.2.0 vendor/redis/examples/dist_redis.rb