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
finsync_redis-3.3.5 examples/dist_redis.rb
redis-4.0.3 examples/dist_redis.rb
redis-4.1.0.beta1 examples/dist_redis.rb
redis-4.0.2 examples/dist_redis.rb
redis-3.3.5 examples/dist_redis.rb
redis-4.0.1 examples/dist_redis.rb
redis-4.0.0 examples/dist_redis.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/dist_redis.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/dist_redis.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/dist_redis.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/dist_redis.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/redis-3.3.3/examples/dist_redis.rb
redis-3.3.3 examples/dist_redis.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.2/examples/dist_redis.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.1/examples/dist_redis.rb
abaci-0.3.0 vendor/bundle/gems/redis-2.2.2/examples/dist_redis.rb
redis-3.3.2 examples/dist_redis.rb
redis-3.3.1 examples/dist_redis.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/examples/dist_redis.rb
redis-3.3.0 examples/dist_redis.rb