Class: Temporalio::Internal::Worker::WorkflowInstance::ExternalWorkflowHandle

Inherits:
Workflow::ExternalWorkflowHandle show all
Defined in:
lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb

Overview

Implementation of the external workflow handle.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, run_id:, instance:) ⇒ ExternalWorkflowHandle

rubocop:disable Lint/MissingSuper



15
16
17
18
19
# File 'lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb', line 15

def initialize(id:, run_id:, instance:) # rubocop:disable Lint/MissingSuper
  @id = id
  @run_id = run_id
  @instance = instance
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



13
14
15
# File 'lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb', line 13

def id
  @id
end

#run_idObject (readonly)

Returns the value of attribute run_id.



13
14
15
# File 'lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb', line 13

def run_id
  @run_id
end

Instance Method Details

#cancelObject



25
26
27
# File 'lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb', line 25

def cancel
  @instance.context._cancel_external_workflow(id:, run_id:)
end

#signal(signal, *args, cancellation: Workflow.cancellation) ⇒ Object



21
22
23
# File 'lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb', line 21

def signal(signal, *args, cancellation: Workflow.cancellation)
  @instance.context._signal_external_workflow(id:, run_id:, signal:, args:, cancellation:)
end