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.6.9 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.8 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.7 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.6 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.5 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.4 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.3 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.2 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.6.1 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
redis-3.0.2 examples/dist_redis.rb
classiccms-0.6.0 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.17 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.16 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.15 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.14 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.13 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.12 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.11 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.10 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
classiccms-0.5.9 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb