Class | AWS::SimpleWorkflow::ActivityTask |
In: |
lib/aws/simple_workflow/activity_task.rb
|
Parent: | Object |
activity_id | [R] | @return [String] The unique identifier of this task. |
activity_type | [R] | @return [ActivityType] |
domain | [R] | @return [Domain] The domain this task was scheduled in. |
input | [R] |
@return [String,nil] The input provided when the activity task was
scheduled. |
started_event_id | [R] |
@return [Integer] The id of the ActivityTaskStarted event recorded
in the history. |
task_token | [R] | @return [String] The opaque string used as a handle on the task. |
workflow_execution | [R] | @return [WorkflowExecution] |
@param [Hash] options
@option options [String] :details (nil)
@option options [String] :reason (nil)
@return [nil]
Reports to the service that the activity task is progressing.
You can optionally specifiy +:details+ that decibe the progress. This might be a percetnage completetion, step number, etc.
activity_task.record_heartbeat! :details => '.75' # 75% complete
If the activity task has been canceled since it was received or since the last recorded heartbeat, this method will raise a CancelRequestedError.
If you are processing the activity task inside a block passed to one of the polling methods in {ActivityTaskCollection} then untrapped CancelRequestedErrors are caught and responded to automatically.
domain.activity_tasks.poll('task-list') do |task| task.record_heartbeat! # raises CancelRequestedError end # traps the error and responds activity task cancled.
If you need to cleanup or provide addtional details in the cancelation response, you can trap the error and respond manually.
domain.activity_tasks.poll('task-list') do |task| task.record_heartbeat! # raises CancelRequestedError rescue CancelRequestedError => e # cleanup task.respond_canceled! :details => '...' end
@param [Hash] options
@option options [String] :details (nil)
If specified, contains details about the progress of the task.