Class: AWS::Flow::ActivityExecutionContext
- Inherits:
-
Object
- Object
- AWS::Flow::ActivityExecutionContext
- Defined in:
- lib/aws/decider/activity_definition.rb
Overview
The execution context for an activity task.
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#service ⇒ Object
Returns the value of attribute service.
-
#task ⇒ Object
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(service, domain, task) ⇒ ActivityExecutionContext
constructor
Initializes a new ‘ActivityExecutionContext` object.
-
#record_activity_heartbeat(details) ⇒ Object
Records a heartbeat for the activity, indicating to Amazon SWF that the activity is still making progress.
-
#task_token ⇒ String
Gets the [task token](docs.aws.amazon.com/AWSRubySDK/latest/AWS/SimpleWorkflow/ActivityTask.html#task_token-instance_method), an opaque string that can be used to uniquely identify this task execution.
-
#workflow_execution ⇒ AWS::SimpleWorkflow::WorkflowExecution
Gets the [AWS::SimpleWorkflow::WorkflowExecution](docs.aws.amazon.com/AWSRubySDK/latest/AWS/SimpleWorkflow/WorkflowExecution.html) instance that is the context for this activity execution.
Constructor Details
#initialize(service, domain, task) ⇒ ActivityExecutionContext
Initializes a new ‘ActivityExecutionContext` object.
107 108 109 110 111 |
# File 'lib/aws/decider/activity_definition.rb', line 107 def initialize(service, domain, task) @service = service @domain = domain @task = task end |
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
90 91 92 |
# File 'lib/aws/decider/activity_definition.rb', line 90 def domain @domain end |
#service ⇒ Object
Returns the value of attribute service.
90 91 92 |
# File 'lib/aws/decider/activity_definition.rb', line 90 def service @service end |
#task ⇒ Object
Returns the value of attribute task.
90 91 92 |
# File 'lib/aws/decider/activity_definition.rb', line 90 def task @task end |
Instance Method Details
#record_activity_heartbeat(details) ⇒ Object
Records a heartbeat for the activity, indicating to Amazon SWF that the activity is still making progress.
141 142 143 144 145 146 147 |
# File 'lib/aws/decider/activity_definition.rb', line 141 def record_activity_heartbeat(details) to_send = {:task_token => task_token.to_s, :details => details.to_s } response = @service.record_activity_task_heartbeat(to_send) # TODO See if cancel requested, throw exception if so raise CancellationException if response["cancelRequested"] end |
#task_token ⇒ String
Gets the [task token](docs.aws.amazon.com/AWSRubySDK/latest/AWS/SimpleWorkflow/ActivityTask.html#task_token-instance_method), an opaque string that can be used to uniquely identify this task execution.
117 118 119 |
# File 'lib/aws/decider/activity_definition.rb', line 117 def task_token @task.task_token end |
#workflow_execution ⇒ AWS::SimpleWorkflow::WorkflowExecution
Gets the [AWS::SimpleWorkflow::WorkflowExecution](docs.aws.amazon.com/AWSRubySDK/latest/AWS/SimpleWorkflow/WorkflowExecution.html) instance that is the context for this activity execution.
128 129 130 |
# File 'lib/aws/decider/activity_definition.rb', line 128 def workflow_execution @task.workflow_execution end |