Class: Airflow::Runner::Poller

Inherits:
Object
  • Object
show all
Defined in:
lib/async_flow/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(persistence) ⇒ Poller

Returns a new instance of Poller.



11
12
13
14
# File 'lib/async_flow/runner.rb', line 11

def initialize(persistence)
  @persistence = persistence
  @queue = Queue.new
end

Instance Attribute Details

#is_workflow_taskObject

Returns the value of attribute is_workflow_task.



9
10
11
# File 'lib/async_flow/runner.rb', line 9

def is_workflow_task
  @is_workflow_task
end

Instance Method Details

#next_task {|task| ... } ⇒ Object

Yields:

  • (task)


16
17
18
19
20
21
# File 'lib/async_flow/runner.rb', line 16

def next_task
  task = persistence.next_task(is_workflow_task: is_workflow_task)
  yield(task) if task
  # TODO: Add db notification
  sleep(1)
end