Class: AWS::Flow::Core::ExternalTask

Inherits:
FlowFiber
  • Object
show all
Defined in:
lib/aws/flow/tasks.rb

Overview

External Tasks are used to bridge asynchronous execution to external asynchronous APIs or events. It is passed a block, like so

external_task do |t|
  t.cancellation_handler { |h, cause| h.fail(cause) }
  t.initiate_task { |h| trace << :task_started; h.complete; }
end

The #initiate_task method is expected to call an external API and return without blocking. Completion or failure of the external task is reported through ExternalTaskCompletionHandle, which is passed into the initiate_task and cancellation_handler blocks. The cancellation handler, defined in the same block as the initiate_task, is used to report the cancellation of the external task.

Instance Attribute Summary collapse

Method Summary

Methods inherited from FlowFiber

#[], [], []=, #[]=, finalize, unset

Instance Attribute Details

#__context__Object

Returns the value of attribute __context__.



162
163
164
# File 'lib/aws/flow/tasks.rb', line 162

def __context__
  @__context__
end

#backtrace=(value) ⇒ Object

Sets the attribute backtrace

Parameters:

  • value

    the value to set the attribute backtrace to.



162
163
164
# File 'lib/aws/flow/tasks.rb', line 162

def backtrace=(value)
  @backtrace = value
end

#blockObject (readonly)

Returns the value of attribute block.



161
162
163
# File 'lib/aws/flow/tasks.rb', line 161

def block
  @block
end

#cancelledObject

Returns the value of attribute cancelled.



162
163
164
# File 'lib/aws/flow/tasks.rb', line 162

def cancelled
  @cancelled
end

#inCancellationHandlerObject

Returns the value of attribute inCancellationHandler.



162
163
164
# File 'lib/aws/flow/tasks.rb', line 162

def inCancellationHandler
  @inCancellationHandler
end

#parentObject

Returns the value of attribute parent.



162
163
164
# File 'lib/aws/flow/tasks.rb', line 162

def parent
  @parent
end