Class: Refinery::BeanstalkQueueProvider
- Inherits:
-
Object
- Object
- Refinery::BeanstalkQueueProvider
- Includes:
- Loggable
- Defined in:
- lib/refinery/beanstalk_queue_provider.rb
Overview
A queue provider for beanstalk
Instance Attribute Summary collapse
-
#queues ⇒ Object
readonly
Returns the value of attribute queues.
Instance Method Summary collapse
-
#initialize(hosts = nil) ⇒ BeanstalkQueueProvider
constructor
Initialize the queue provider.
-
#queue(name) ⇒ Object
Get the named queue.
Methods included from Loggable
Constructor Details
#initialize(hosts = nil) ⇒ BeanstalkQueueProvider
Initialize the queue provider
9 10 11 12 |
# File 'lib/refinery/beanstalk_queue_provider.rb', line 9 def initialize(hosts=nil) @hosts = hosts @queues = {} end |
Instance Attribute Details
#queues ⇒ Object (readonly)
Returns the value of attribute queues.
6 7 8 |
# File 'lib/refinery/beanstalk_queue_provider.rb', line 6 def queues @queues end |
Instance Method Details
#queue(name) ⇒ Object
Get the named queue
14 15 16 |
# File 'lib/refinery/beanstalk_queue_provider.rb', line 14 def queue(name) queues[name] ||= Refinery::BeanstalkQueue.new(name, @hosts) end |