Class: Temporalio::Workflow::NexusClient

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/workflow/nexus_client.rb

Overview

Client for executing Nexus operations from workflows.

This is created via create_nexus_client, it is never instantiated directly.

WARNING: Nexus support is experimental.

Instance Method Summary collapse

Instance Method Details

#endpointString

Returns Endpoint name for this client.

Returns:

  • (String)

    Endpoint name for this client.

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/temporalio/workflow/nexus_client.rb', line 17

def endpoint
  raise NotImplementedError
end

#execute_operation(operation, arg, schedule_to_close_timeout: nil, cancellation_type: NexusOperationCancellationType::WAIT_CANCELLATION_COMPLETED, summary: nil, cancellation: Workflow.cancellation, arg_hint: nil, result_hint: nil) ⇒ Object

Execute a Nexus operation and wait for the result.

This is a convenience method that calls #start_operation and immediately waits for the result.

Parameters:

  • operation (Symbol, String)

    Operation name.

  • arg (Object)

    Argument for the operation.

  • schedule_to_close_timeout (Float, nil) (defaults to: nil)

    Total timeout for the operation in seconds.

  • cancellation_type (NexusOperationCancellationType) (defaults to: NexusOperationCancellationType::WAIT_CANCELLATION_COMPLETED)

    How the operation will react to cancellation.

  • summary (String, nil) (defaults to: nil)

    Optional summary for the operation (appears in UI/CLI).

  • cancellation (Cancellation) (defaults to: Workflow.cancellation)

    Cancellation for the operation.

  • arg_hint (Object, nil) (defaults to: nil)

    Converter hint for the argument.

  • result_hint (Object, nil) (defaults to: nil)

    Converter hint for the result.

Returns:

  • (Object)

    Result of the operation.

Raises:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/temporalio/workflow/nexus_client.rb', line 64

def execute_operation(
  operation,
  arg,
  schedule_to_close_timeout: nil,
  cancellation_type: NexusOperationCancellationType::WAIT_CANCELLATION_COMPLETED,
  summary: nil,
  cancellation: Workflow.cancellation,
  arg_hint: nil,
  result_hint: nil
)
  start_operation(
    operation, arg, schedule_to_close_timeout:, cancellation_type:, summary:, cancellation:,
                    arg_hint:, result_hint:
  ).result
end

#serviceString

Returns Service name for this client.

Returns:

  • (String)

    Service name for this client.

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/temporalio/workflow/nexus_client.rb', line 22

def service
  raise NotImplementedError
end

#start_operation(operation, arg, schedule_to_close_timeout: nil, cancellation_type: NexusOperationCancellationType::WAIT_CANCELLATION_COMPLETED, summary: nil, cancellation: Workflow.cancellation, arg_hint: nil, result_hint: nil) ⇒ NexusOperationHandle

Start a Nexus operation and return a handle.

Parameters:

  • operation (Symbol, String)

    Operation name.

  • arg (Object)

    Argument for the operation.

  • schedule_to_close_timeout (Float, nil) (defaults to: nil)

    Total timeout for the operation in seconds.

  • cancellation_type (NexusOperationCancellationType) (defaults to: NexusOperationCancellationType::WAIT_CANCELLATION_COMPLETED)

    How the operation will react to cancellation.

  • summary (String, nil) (defaults to: nil)

    Optional summary for the operation (appears in UI/CLI).

  • cancellation (Cancellation) (defaults to: Workflow.cancellation)

    Cancellation for the operation.

  • arg_hint (Object, nil) (defaults to: nil)

    Converter hint for the argument.

  • result_hint (Object, nil) (defaults to: nil)

    Converter hint for the result.

Returns:

Raises:

  • (NotImplementedError)


37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/temporalio/workflow/nexus_client.rb', line 37

def start_operation(
  operation,
  arg,
  schedule_to_close_timeout: nil,
  cancellation_type: NexusOperationCancellationType::WAIT_CANCELLATION_COMPLETED,
  summary: nil,
  cancellation: Workflow.cancellation,
  arg_hint: nil,
  result_hint: nil
)
  raise NotImplementedError
end