Class: Cadence::Workflow::Poller
- Inherits:
-
Object
- Object
- Cadence::Workflow::Poller
- Defined in:
- lib/cadence/workflow/poller.rb
Instance Method Summary collapse
-
#initialize(domain, task_list, workflow_lookup, middleware = [], options = {}) ⇒ Poller
constructor
A new instance of Poller.
- #start ⇒ Object
- #stop ⇒ Object
- #wait ⇒ Object
Constructor Details
#initialize(domain, task_list, workflow_lookup, middleware = [], options = {}) ⇒ Poller
Returns a new instance of Poller.
8 9 10 11 12 13 14 15 |
# File 'lib/cadence/workflow/poller.rb', line 8 def initialize(domain, task_list, workflow_lookup, middleware = [], = {}) @domain = domain @task_list = task_list @workflow_lookup = workflow_lookup @middleware = middleware @options = @shutting_down = false end |
Instance Method Details
#start ⇒ Object
17 18 19 20 |
# File 'lib/cadence/workflow/poller.rb', line 17 def start @shutting_down = false @thread = Thread.new(&method(:poll_loop)) end |
#stop ⇒ Object
22 23 24 25 |
# File 'lib/cadence/workflow/poller.rb', line 22 def stop @shutting_down = true Cadence.logger.info('Shutting down a workflow poller') end |
#wait ⇒ Object
27 28 29 |
# File 'lib/cadence/workflow/poller.rb', line 27 def wait @thread.join end |