Class: Workling::Invokers::BasicPoller
- Defined in:
- lib/workling/invokers/basic_poller.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(routing, client_class) ⇒ BasicPoller
constructor
set up client, sleep time.
-
#listen ⇒ Object
Starts main Invoker Loop.
-
#stop ⇒ Object
Gracefully stops the Invoker.
Methods inherited from Base
Constructor Details
#initialize(routing, client_class) ⇒ BasicPoller
set up client, sleep time
11 12 13 |
# File 'lib/workling/invokers/basic_poller.rb', line 11 def initialize(routing, client_class) super end |
Instance Method Details
#listen ⇒ Object
Starts main Invoker Loop. The invoker runs until stop() is called.
18 19 20 21 22 23 24 25 26 |
# File 'lib/workling/invokers/basic_poller.rb', line 18 def listen connect do loop_routes do |route| if args = @client.retrieve(route) run(route, args) end end end end |
#stop ⇒ Object
Gracefully stops the Invoker. The currently executing Jobs should be allowed
to finish.
32 33 34 |
# File 'lib/workling/invokers/basic_poller.rb', line 32 def stop @shutdown = true end |