Class: AWS::Flow::Core::TaskContext Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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(options = {})
  @parent = options[:parent]
  @task = options[:task]
  @task.__context__ = self
  @non_cancelling = options[:non_cancelling]
  @daemon = options[:daemon]
end

Instance Attribute Details

#backtraceObject

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

#cancelledObject

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

#daemonObject

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

#parentObject

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.

Returns:

  • (Boolean)


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

#executorObject

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_scopeObject

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_heirsObject

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