Sha256: 07b296700865eeab2583c7cd911724fbaa88f77d926f9a1c9981e9534e437b17
Contents?: true
Size: 574 Bytes
Versions: 17
Compression:
Stored size: 574 Bytes
Contents
module MessageQueue class Kestrel < Base def initialize(opts) @servers = opts['servers'] end def queue_size(queue) size = 0 stats = client.stats servers.each do |server| size += stats[server]["queue_#{queue}_items"].to_i end size end def enqueue(queue, data) client.set(queue, data) end def dequeue(queue) client.get("#{queue}/open") end def confirm(queue) client.get("#{queue}/close") end def client @client ||= MemCache.new(servers) end end end
Version data entries
17 entries across 17 versions & 5 rubygems