Sha256: fcc1b7ce4a3dcfad1326167edfd4ed2ce43d9e431c21e48f6bb7f0f0db563224
Contents?: true
Size: 537 Bytes
Versions: 1
Compression:
Stored size: 537 Bytes
Contents
$:.unshift(File.expand_path('../../../../ruote/lib', __FILE__)) $:.unshift(File.expand_path('../../../lib', __FILE__)) require 'rubygems' require 'pp' require 'redis' N = 10_000 redis = ::Redis.new('db' => 12, 'thread_safe' => true) p redis.del('put_gun') N.times do msg = (Time.now.to_f.to_s + '__') * 50 redis.rpush('put_gun', msg) end p redis.llen('put_gun') results = [] loop do x = redis.lpop('put_gun') break unless x results << x end p results.size p results.sort.uniq.size # it's always N, redis is great
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruote-redis-2.3.0 | test/bughunt/put_gun.rb |