Class: AWS::Flow::Core::ExternalTask
- 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
-
#__context__ ⇒ Object
Returns the value of attribute __context__.
-
#backtrace ⇒ Object
writeonly
Sets the attribute backtrace.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#cancelled ⇒ Object
Returns the value of attribute cancelled.
-
#inCancellationHandler ⇒ Object
Returns the value of attribute inCancellationHandler.
-
#parent ⇒ Object
Returns the value of attribute parent.
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
162 163 164 |
# File 'lib/aws/flow/tasks.rb', line 162 def backtrace=(value) @backtrace = value end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
161 162 163 |
# File 'lib/aws/flow/tasks.rb', line 161 def block @block end |
#cancelled ⇒ Object
Returns the value of attribute cancelled.
162 163 164 |
# File 'lib/aws/flow/tasks.rb', line 162 def cancelled @cancelled end |
#inCancellationHandler ⇒ Object
Returns the value of attribute inCancellationHandler.
162 163 164 |
# File 'lib/aws/flow/tasks.rb', line 162 def inCancellationHandler @inCancellationHandler end |
#parent ⇒ Object
Returns the value of attribute parent.
162 163 164 |
# File 'lib/aws/flow/tasks.rb', line 162 def parent @parent end |