class AWS::Flow::Core::TaskContext
Holds some metadata for tasks and stores the parent link for tasks. It separates some of the concerns between tasks and what they have to know to follow back up the chain.
All the methods here will simply delegate calls, either up to the parent, or down to the task.
@api private
Attributes
backtrace[RW]
cancelled[RW]
daemon[RW]
parent[RW]
Public Class Methods
new(options = {})
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 386 def initialize(options = {}) @parent = options[:parent] @task = options[:task] @task.__context__ = self @non_cancelling = options[:non_cancelling] @daemon = options[:daemon] end
Public Instance Methods
<<(task)
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 433 def <<(task) @parent << task end
alive?()
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 401 def alive? @task.alive? end
cancel(error_type)
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 427 def cancel(error_type) @task.cancelled = true @parent.cancel(self) end
executor()
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 406 def executor @parent.executor end
fail(this_task, error)
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 417 def fail(this_task, error) @parent.fail(this_task, error) end
get_closest_containing_scope()
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 395 def get_closest_containing_scope @task # @ parent end
get_heirs()
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 411 def get_heirs str = "I am a #{@task.class} and my block looks like #{@task.block}" end
remove(thread)
click to toggle source
@api private
# File lib/aws/flow/tasks.rb, line 422 def remove(thread) @parent.remove(thread) end