Class: Workling::Remote::Invokers::BasicPoller
- Defined in:
- lib/workling/remote/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
14 15 16 |
# File 'lib/workling/remote/invokers/basic_poller.rb', line 14 def initialize(routing, client_class) super end |
Instance Method Details
#listen ⇒ Object
Starts main Invoker Loop. The invoker runs until stop() is called.
21 22 23 24 25 26 27 28 29 |
# File 'lib/workling/remote/invokers/basic_poller.rb', line 21 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.
35 36 37 |
# File 'lib/workling/remote/invokers/basic_poller.rb', line 35 def stop @shutdown = true end |