Class: AWS::Flow::Core::TaskContext Private
- Inherits:
-
Object
- Object
- AWS::Flow::Core::TaskContext
- Defined in:
- lib/aws/flow/tasks.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
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.
Instance Attribute Summary collapse
- #backtrace ⇒ Object private
- #cancelled ⇒ Object private
- #daemon ⇒ Object private
- #parent ⇒ Object private
Instance Method Summary collapse
- #<<(task) ⇒ Object private
- #alive? ⇒ Boolean private
- #cancel(error_type) ⇒ Object private
- #executor ⇒ Object private
- #fail(this_task, error) ⇒ Object private
- #get_closest_containing_scope ⇒ Object private
- #get_heirs ⇒ Object private
-
#initialize(options = {}) ⇒ TaskContext
constructor
private
A new instance of TaskContext.
- #remove(thread) ⇒ Object private
Constructor Details
#initialize(options = {}) ⇒ TaskContext
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TaskContext.
386 387 388 389 390 391 392 |
# File 'lib/aws/flow/tasks.rb', line 386 def initialize( = {}) @parent = [:parent] @task = [:task] @task.__context__ = self @non_cancelling = [:non_cancelling] @daemon = [:daemon] end |
Instance Attribute Details
#backtrace ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
383 384 385 |
# File 'lib/aws/flow/tasks.rb', line 383 def backtrace @backtrace end |
#cancelled ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
383 384 385 |
# File 'lib/aws/flow/tasks.rb', line 383 def cancelled @cancelled end |
#daemon ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
383 384 385 |
# File 'lib/aws/flow/tasks.rb', line 383 def daemon @daemon end |
#parent ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
383 384 385 |
# File 'lib/aws/flow/tasks.rb', line 383 def parent @parent end |
Instance Method Details
#<<(task) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
433 434 435 |
# File 'lib/aws/flow/tasks.rb', line 433 def <<(task) @parent << task end |
#alive? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
401 402 403 |
# File 'lib/aws/flow/tasks.rb', line 401 def alive? @task.alive? end |
#cancel(error_type) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
427 428 429 430 |
# File 'lib/aws/flow/tasks.rb', line 427 def cancel(error_type) @task.cancelled = true @parent.cancel(self) end |
#executor ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
406 407 408 |
# File 'lib/aws/flow/tasks.rb', line 406 def executor @parent.executor end |
#fail(this_task, error) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
417 418 419 |
# File 'lib/aws/flow/tasks.rb', line 417 def fail(this_task, error) @parent.fail(this_task, error) end |
#get_closest_containing_scope ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
395 396 397 398 |
# File 'lib/aws/flow/tasks.rb', line 395 def get_closest_containing_scope @task # @ parent end |
#get_heirs ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
411 412 413 414 |
# 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) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
422 423 424 |
# File 'lib/aws/flow/tasks.rb', line 422 def remove(thread) @parent.remove(thread) end |