class PerfectQueue::Queue
Public Class Methods
new(client)
click to toggle source
Calls superclass method
PerfectQueue::Model::new
# File lib/perfectqueue/queue.rb, line 23 def initialize(client) super(client) end
Public Instance Methods
[](key)
click to toggle source
# File lib/perfectqueue/queue.rb, line 27 def [](key) Task.new(@client, key) end
close()
click to toggle source
# File lib/perfectqueue/queue.rb, line 53 def close client.close end
each(options={}, &block)
click to toggle source
# File lib/perfectqueue/queue.rb, line 31 def each(options={}, &block) @client.list(options, &block) end
poll(options={})
click to toggle source
# File lib/perfectqueue/queue.rb, line 37 def poll(options={}) options = options.merge({:max_acquire=>1}) if acquired = poll_multi(options) return acquired[0] end return nil end
poll_multi(options={})
click to toggle source
# File lib/perfectqueue/queue.rb, line 45 def poll_multi(options={}) @client.acquire(options) end
submit(key, type, data, options={})
click to toggle source
# File lib/perfectqueue/queue.rb, line 49 def submit(key, type, data, options={}) @client.submit(key, type, data, options) end