Class: ObjectQueue
- Inherits:
-
MessageQueue
- Object
- RedisConnection
- MessageQueue
- ObjectQueue
- Defined in:
- lib/redis_store.rb
Instance Attribute Summary
Attributes inherited from MessageQueue
Attributes inherited from RedisConnection
Instance Method Summary collapse
- #pop ⇒ Object
-
#push(item) ⇒ Object
end pop.
Methods inherited from MessageQueue
#del, #info, #initialize, #size, #to_s
Methods inherited from RedisConnection
Constructor Details
This class inherits a constructor from MessageQueue
Instance Method Details
#pop ⇒ Object
72 73 74 |
# File 'lib/redis_store.rb', line 72 def pop() Marshal.load(@redis.blpop(@key)[1]) end |
#push(item) ⇒ Object
end pop
76 77 78 79 80 81 82 83 |
# File 'lib/redis_store.rb', line 76 def push(item) redis.pipelined do @redis.hincrby "counters", @key, 1 #@redis.incr(@key+"_count") #@redis.incr(keygen+"_count") @redis.rpush(@key, Marshal.dump(item) ) end end |