Class: Queuel::Base::Poller
- Inherits:
-
Object
- Object
- Queuel::Base::Poller
- Extended by:
- Forwardable
- Defined in:
- lib/queuel/base/poller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(queue, param_block, options = {}, workers = 1) ⇒ Poller
constructor
A new instance of Poller.
- #poll ⇒ Object
Constructor Details
#initialize(queue, param_block, options = {}, workers = 1) ⇒ Poller
Returns a new instance of Poller.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/queuel/base/poller.rb', line 10 def initialize(queue, param_block, = {}, workers = 1) self.workers = workers self.queue = queue self. = || {} self.inst_block = param_block self.tries = 0 self.continue_looping = true self.pool_tasks = 0 self.mutex = Mutex.new end |
Instance Method Details
#poll ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/queuel/base/poller.rb', line 21 def poll register_trappers logger.debug("Beginning Poll...") self.master = master_thread log_action(:joining, :master) { master.join } rescue SignalException => e logger.warn "Caught (#{e}), shutting Poller down" log_action(:killing, :poller, :warn) { shutdown } end |