Class: Temporalio::Client::AsyncActivityHandle
- Inherits:
-
Object
- Object
- Temporalio::Client::AsyncActivityHandle
- Defined in:
- lib/temporalio/client/async_activity_handle.rb
Overview
Handle representing an external activity for completion and heartbeat. This is usually created via #async_activity_handle.
Instance Attribute Summary collapse
- #id_reference ⇒ ActivityIDReference? readonly
-
#task_token ⇒ String?
readonly
Task token if created with a task token.
Instance Method Summary collapse
-
#complete(result = nil, rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Complete the activity.
-
#fail(error, last_heartbeat_details: [], rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Fail the activity.
-
#heartbeat(*details, rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Record a heartbeat for the activity.
-
#report_cancellation(*details, rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Report the activity as canceled.
Instance Attribute Details
#id_reference ⇒ ActivityIDReference? (readonly)
18 19 20 |
# File 'lib/temporalio/client/async_activity_handle.rb', line 18 def id_reference @id_reference end |
#task_token ⇒ String? (readonly)
Returns Task token if created with a task token. Mutually exclusive with #id_reference.
14 15 16 |
# File 'lib/temporalio/client/async_activity_handle.rb', line 14 def task_token @task_token end |
Instance Method Details
#complete(result = nil, rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Complete the activity.
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/temporalio/client/async_activity_handle.rb', line 50 def complete( result = nil, rpc_metadata: nil, rpc_timeout: nil ) @client._impl.complete_async_activity(Interceptor::CompleteAsyncActivityInput.new( task_token_or_id_reference:, result:, rpc_metadata:, rpc_timeout: )) end |
#fail(error, last_heartbeat_details: [], rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Fail the activity.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/temporalio/client/async_activity_handle.rb', line 69 def fail( error, last_heartbeat_details: [], rpc_metadata: nil, rpc_timeout: nil ) @client._impl.fail_async_activity(Interceptor::FailAsyncActivityInput.new( task_token_or_id_reference:, error:, last_heartbeat_details:, rpc_metadata:, rpc_timeout: )) end |
#heartbeat(*details, rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Record a heartbeat for the activity.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/temporalio/client/async_activity_handle.rb', line 32 def heartbeat( *details, rpc_metadata: nil, rpc_timeout: nil ) @client._impl.heartbeat_async_activity(Interceptor::HeartbeatAsyncActivityInput.new( task_token_or_id_reference:, details:, rpc_metadata:, rpc_timeout: )) end |
#report_cancellation(*details, rpc_metadata: nil, rpc_timeout: nil) ⇒ Object
Report the activity as canceled.
90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/temporalio/client/async_activity_handle.rb', line 90 def report_cancellation( *details, rpc_metadata: nil, rpc_timeout: nil ) @client._impl.report_cancellation_async_activity(Interceptor::ReportCancellationAsyncActivityInput.new( task_token_or_id_reference:, details:, rpc_metadata:, rpc_timeout: )) end |