Class: QueueingProxy::DSL::Backend
- Inherits:
-
Object
- Object
- QueueingProxy::DSL::Backend
- Defined in:
- lib/queueing_proxy/dsl.rb
Instance Attribute Summary collapse
-
#beanstalk_host ⇒ Object
readonly
Returns the value of attribute beanstalk_host.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#tube ⇒ Object
readonly
Returns the value of attribute tube.
Instance Method Summary collapse
-
#initialize(host = 'localhost', port = 80, workers = 4, &block) ⇒ Backend
constructor
A new instance of Backend.
- #logger(logger) ⇒ Object
- #queue_with(beanstalkd_host, tube) ⇒ Object
- #workers(workers = nil) ⇒ Object
Constructor Details
#initialize(host = 'localhost', port = 80, workers = 4, &block) ⇒ Backend
Returns a new instance of Backend.
8 9 10 11 12 |
# File 'lib/queueing_proxy/dsl.rb', line 8 def initialize(host='localhost', port=80, workers=4, &block) @host, @port, @workers, @beanstalk_host, @tube = host, port, workers, 'localhost', 'default' instance_exec(&block) if block_given? self end |
Instance Attribute Details
#beanstalk_host ⇒ Object (readonly)
Returns the value of attribute beanstalk_host.
6 7 8 |
# File 'lib/queueing_proxy/dsl.rb', line 6 def beanstalk_host @beanstalk_host end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
6 7 8 |
# File 'lib/queueing_proxy/dsl.rb', line 6 def host @host end |
#tube ⇒ Object (readonly)
Returns the value of attribute tube.
6 7 8 |
# File 'lib/queueing_proxy/dsl.rb', line 6 def tube @tube end |
Instance Method Details
#logger(logger) ⇒ Object
28 29 30 31 |
# File 'lib/queueing_proxy/dsl.rb', line 28 def logger(logger) @logger = logger self end |
#queue_with(beanstalkd_host, tube) ⇒ Object
14 15 16 17 |
# File 'lib/queueing_proxy/dsl.rb', line 14 def queue_with(beanstalkd_host, tube) @beanstalk_host, @tube = beanstalkd_host, tube self end |