Class: Cadence::Workflow::Poller

Inherits:
Object
  • Object
show all
Defined in:
lib/cadence/workflow/poller.rb

Instance Method Summary collapse

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 = [], options = {})
  @domain = domain
  @task_list = task_list
  @workflow_lookup = workflow_lookup
  @middleware = middleware
  @options = options
  @shutting_down = false
end

Instance Method Details

#startObject



17
18
19
20
# File 'lib/cadence/workflow/poller.rb', line 17

def start
  @shutting_down = false
  @thread = Thread.new(&method(:poll_loop))
end

#stopObject



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

#waitObject



27
28
29
# File 'lib/cadence/workflow/poller.rb', line 27

def wait
  @thread.join
end