Class: Refinery::BeanstalkQueueProvider

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/refinery/beanstalk_queue_provider.rb

Overview

A queue provider for beanstalk

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Loggable

#logger

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

#queuesObject (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