Class: QueueingProxy::Frontend::Queuer
- Inherits:
-
Thin::Connection
- Object
- Thin::Connection
- QueueingProxy::Frontend::Queuer
- Defined in:
- lib/queueing_proxy/frontend.rb
Instance Attribute Summary collapse
-
#beanstalks ⇒ Object
Returns the value of attribute beanstalks.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
Instance Attribute Details
#beanstalks ⇒ Object
Returns the value of attribute beanstalks.
43 44 45 |
# File 'lib/queueing_proxy/frontend.rb', line 43 def beanstalks @beanstalks end |
#logger ⇒ Object
Returns the value of attribute logger.
43 44 45 |
# File 'lib/queueing_proxy/frontend.rb', line 43 def logger @logger end |
Instance Method Details
#post_init ⇒ Object
45 46 47 48 |
# File 'lib/queueing_proxy/frontend.rb', line 45 def post_init @data = '' super end |
#queue_data ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'lib/queueing_proxy/frontend.rb', line 60 def queue_data if @data != '' beanstalks.each {|b| b.put(@data) {|id| logger.info "Frontend enqueued job #{id} to #{b}" } } end end |
#receive_data(data) ⇒ Object
50 51 52 53 |
# File 'lib/queueing_proxy/frontend.rb', line 50 def receive_data(data) @data << data super(data) end |
#unbind ⇒ Object
55 56 57 58 |
# File 'lib/queueing_proxy/frontend.rb', line 55 def unbind queue_data super end |