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, result_hint: nil, rpc_options: nil)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Complete the activity.
 - 
  
    
      #fail(error, last_heartbeat_details: [], last_heartbeat_detail_hints: nil, rpc_options: nil)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Fail the activity.
 - 
  
    
      #heartbeat(*details, detail_hints: nil, rpc_options: nil)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Record a heartbeat for the activity.
 - 
  
    
      #report_cancellation(*details, detail_hints: nil, rpc_options: 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, result_hint: nil, rpc_options: nil) ⇒ Object
Complete the activity.
      47 48 49 50 51 52 53 54  | 
    
      # File 'lib/temporalio/client/async_activity_handle.rb', line 47 def complete(result = nil, result_hint: nil, rpc_options: nil) @client._impl.complete_async_activity(Interceptor::CompleteAsyncActivityInput.new( task_token_or_id_reference:, result:, result_hint:, rpc_options: )) end  | 
  
#fail(error, last_heartbeat_details: [], last_heartbeat_detail_hints: nil, rpc_options: nil) ⇒ Object
Fail the activity.
      62 63 64 65 66 67 68 69 70  | 
    
      # File 'lib/temporalio/client/async_activity_handle.rb', line 62 def fail(error, last_heartbeat_details: [], last_heartbeat_detail_hints: nil, rpc_options: nil) @client._impl.fail_async_activity(Interceptor::FailAsyncActivityInput.new( task_token_or_id_reference:, error:, last_heartbeat_details:, last_heartbeat_detail_hints:, rpc_options: )) end  | 
  
#heartbeat(*details, detail_hints: nil, rpc_options: nil) ⇒ Object
Record a heartbeat for the activity.
      33 34 35 36 37 38 39 40  | 
    
      # File 'lib/temporalio/client/async_activity_handle.rb', line 33 def heartbeat(*details, detail_hints: nil, rpc_options: nil) @client._impl.heartbeat_async_activity(Interceptor::HeartbeatAsyncActivityInput.new( task_token_or_id_reference:, details:, detail_hints:, rpc_options: )) end  | 
  
#report_cancellation(*details, detail_hints: nil, rpc_options: nil) ⇒ Object
Report the activity as canceled.
      78 79 80 81 82 83 84 85  | 
    
      # File 'lib/temporalio/client/async_activity_handle.rb', line 78 def report_cancellation(*details, detail_hints: nil, rpc_options: nil) @client._impl.report_cancellation_async_activity(Interceptor::ReportCancellationAsyncActivityInput.new( task_token_or_id_reference:, details:, detail_hints:, rpc_options: )) end  |