temporalio 0.2.0-aarch64-linux → 0.4.0-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/Gemfile +7 -3
- data/Rakefile +10 -296
- data/lib/temporalio/activity/complete_async_error.rb +1 -1
- data/lib/temporalio/activity/context.rb +18 -2
- data/lib/temporalio/activity/definition.rb +180 -65
- data/lib/temporalio/activity/info.rb +25 -21
- data/lib/temporalio/activity.rb +2 -59
- data/lib/temporalio/api/activity/v1/message.rb +25 -0
- data/lib/temporalio/api/batch/v1/message.rb +6 -1
- data/lib/temporalio/api/cloud/account/v1/message.rb +28 -0
- data/lib/temporalio/api/cloud/cloudservice/v1/request_response.rb +34 -1
- data/lib/temporalio/api/cloud/cloudservice/v1/service.rb +1 -1
- data/lib/temporalio/api/cloud/identity/v1/message.rb +6 -1
- data/lib/temporalio/api/cloud/namespace/v1/message.rb +8 -1
- data/lib/temporalio/api/cloud/nexus/v1/message.rb +31 -0
- data/lib/temporalio/api/cloud/operation/v1/message.rb +2 -1
- data/lib/temporalio/api/cloud/region/v1/message.rb +2 -1
- data/lib/temporalio/api/cloud/resource/v1/message.rb +23 -0
- data/lib/temporalio/api/cloud/sink/v1/message.rb +24 -0
- data/lib/temporalio/api/cloud/usage/v1/message.rb +31 -0
- data/lib/temporalio/api/command/v1/message.rb +1 -1
- data/lib/temporalio/api/common/v1/message.rb +8 -1
- data/lib/temporalio/api/deployment/v1/message.rb +38 -0
- data/lib/temporalio/api/enums/v1/batch_operation.rb +1 -1
- data/lib/temporalio/api/enums/v1/common.rb +1 -1
- data/lib/temporalio/api/enums/v1/deployment.rb +23 -0
- data/lib/temporalio/api/enums/v1/event_type.rb +1 -1
- data/lib/temporalio/api/enums/v1/failed_cause.rb +1 -1
- data/lib/temporalio/api/enums/v1/nexus.rb +21 -0
- data/lib/temporalio/api/enums/v1/reset.rb +1 -1
- data/lib/temporalio/api/enums/v1/workflow.rb +2 -1
- data/lib/temporalio/api/errordetails/v1/message.rb +3 -1
- data/lib/temporalio/api/failure/v1/message.rb +3 -1
- data/lib/temporalio/api/history/v1/message.rb +3 -1
- data/lib/temporalio/api/nexus/v1/message.rb +3 -2
- data/lib/temporalio/api/operatorservice/v1/service.rb +1 -1
- data/lib/temporalio/api/payload_visitor.rb +1581 -0
- data/lib/temporalio/api/query/v1/message.rb +2 -1
- data/lib/temporalio/api/schedule/v1/message.rb +2 -1
- data/lib/temporalio/api/taskqueue/v1/message.rb +4 -1
- data/lib/temporalio/api/testservice/v1/request_response.rb +31 -0
- data/lib/temporalio/api/testservice/v1/service.rb +23 -0
- data/lib/temporalio/api/workflow/v1/message.rb +9 -1
- data/lib/temporalio/api/workflowservice/v1/request_response.rb +46 -2
- data/lib/temporalio/api/workflowservice/v1/service.rb +1 -1
- data/lib/temporalio/api.rb +2 -0
- data/lib/temporalio/cancellation.rb +34 -14
- data/lib/temporalio/client/async_activity_handle.rb +12 -37
- data/lib/temporalio/client/connection/cloud_service.rb +309 -231
- data/lib/temporalio/client/connection/operator_service.rb +36 -84
- data/lib/temporalio/client/connection/service.rb +6 -5
- data/lib/temporalio/client/connection/test_service.rb +111 -0
- data/lib/temporalio/client/connection/workflow_service.rb +474 -441
- data/lib/temporalio/client/connection.rb +90 -44
- data/lib/temporalio/client/interceptor.rb +199 -60
- data/lib/temporalio/client/schedule.rb +991 -0
- data/lib/temporalio/client/schedule_handle.rb +126 -0
- data/lib/temporalio/client/with_start_workflow_operation.rb +115 -0
- data/lib/temporalio/client/workflow_execution.rb +26 -10
- data/lib/temporalio/client/workflow_handle.rb +41 -98
- data/lib/temporalio/client/workflow_update_handle.rb +3 -5
- data/lib/temporalio/client.rb +247 -44
- data/lib/temporalio/common_enums.rb +17 -0
- data/lib/temporalio/contrib/open_telemetry.rb +470 -0
- data/lib/temporalio/converters/data_converter.rb +4 -7
- data/lib/temporalio/converters/failure_converter.rb +5 -3
- data/lib/temporalio/converters/payload_converter/composite.rb +4 -0
- data/lib/temporalio/converters/payload_converter.rb +6 -8
- data/lib/temporalio/converters/raw_value.rb +20 -0
- data/lib/temporalio/error/failure.rb +1 -1
- data/lib/temporalio/error.rb +11 -2
- data/lib/temporalio/internal/bridge/3.2/temporalio_bridge.so +0 -0
- data/lib/temporalio/internal/bridge/3.3/temporalio_bridge.so +0 -0
- data/lib/temporalio/internal/bridge/{3.1 → 3.4}/temporalio_bridge.so +0 -0
- data/lib/temporalio/internal/bridge/api/activity_task/activity_task.rb +1 -1
- data/lib/temporalio/internal/bridge/api/common/common.rb +2 -1
- data/lib/temporalio/internal/bridge/api/core_interface.rb +5 -1
- data/lib/temporalio/internal/bridge/api/nexus/nexus.rb +33 -0
- data/lib/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rb +5 -1
- data/lib/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rb +4 -1
- data/lib/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rb +2 -1
- data/lib/temporalio/internal/bridge/client.rb +11 -6
- data/lib/temporalio/internal/bridge/runtime.rb +3 -0
- data/lib/temporalio/internal/bridge/testing.rb +23 -0
- data/lib/temporalio/internal/bridge/worker.rb +2 -0
- data/lib/temporalio/internal/bridge.rb +1 -1
- data/lib/temporalio/internal/client/implementation.rb +468 -71
- data/lib/temporalio/internal/metric.rb +122 -0
- data/lib/temporalio/internal/proto_utils.rb +118 -7
- data/lib/temporalio/internal/worker/activity_worker.rb +69 -29
- data/lib/temporalio/internal/worker/multi_runner.rb +53 -9
- data/lib/temporalio/internal/worker/workflow_instance/child_workflow_handle.rb +54 -0
- data/lib/temporalio/internal/worker/workflow_instance/context.rb +383 -0
- data/lib/temporalio/internal/worker/workflow_instance/details.rb +46 -0
- data/lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb +32 -0
- data/lib/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rb +22 -0
- data/lib/temporalio/internal/worker/workflow_instance/handler_execution.rb +25 -0
- data/lib/temporalio/internal/worker/workflow_instance/handler_hash.rb +41 -0
- data/lib/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rb +97 -0
- data/lib/temporalio/internal/worker/workflow_instance/inbound_implementation.rb +62 -0
- data/lib/temporalio/internal/worker/workflow_instance/outbound_implementation.rb +400 -0
- data/lib/temporalio/internal/worker/workflow_instance/replay_safe_logger.rb +37 -0
- data/lib/temporalio/internal/worker/workflow_instance/replay_safe_metric.rb +40 -0
- data/lib/temporalio/internal/worker/workflow_instance/scheduler.rb +183 -0
- data/lib/temporalio/internal/worker/workflow_instance.rb +774 -0
- data/lib/temporalio/internal/worker/workflow_worker.rb +239 -0
- data/lib/temporalio/metric.rb +109 -0
- data/lib/temporalio/retry_policy.rb +37 -14
- data/lib/temporalio/runtime/metric_buffer.rb +94 -0
- data/lib/temporalio/runtime.rb +160 -79
- data/lib/temporalio/search_attributes.rb +93 -37
- data/lib/temporalio/testing/activity_environment.rb +44 -16
- data/lib/temporalio/testing/workflow_environment.rb +276 -7
- data/lib/temporalio/version.rb +1 -1
- data/lib/temporalio/worker/activity_executor/thread_pool.rb +9 -217
- data/lib/temporalio/worker/activity_executor.rb +3 -3
- data/lib/temporalio/worker/interceptor.rb +343 -66
- data/lib/temporalio/worker/thread_pool.rb +237 -0
- data/lib/temporalio/worker/tuner.rb +38 -0
- data/lib/temporalio/worker/workflow_executor/thread_pool.rb +235 -0
- data/lib/temporalio/worker/workflow_executor.rb +26 -0
- data/lib/temporalio/worker/workflow_replayer.rb +350 -0
- data/lib/temporalio/worker.rb +235 -58
- data/lib/temporalio/workflow/activity_cancellation_type.rb +20 -0
- data/lib/temporalio/workflow/child_workflow_cancellation_type.rb +21 -0
- data/lib/temporalio/workflow/child_workflow_handle.rb +43 -0
- data/lib/temporalio/workflow/definition.rb +598 -0
- data/lib/temporalio/workflow/external_workflow_handle.rb +41 -0
- data/lib/temporalio/workflow/future.rb +151 -0
- data/lib/temporalio/workflow/handler_unfinished_policy.rb +13 -0
- data/lib/temporalio/workflow/info.rb +104 -0
- data/lib/temporalio/workflow/parent_close_policy.rb +19 -0
- data/lib/temporalio/workflow/update_info.rb +20 -0
- data/lib/temporalio/workflow.rb +575 -0
- data/lib/temporalio/workflow_history.rb +26 -1
- data/lib/temporalio.rb +4 -0
- data/temporalio.gemspec +4 -3
- metadata +75 -8
| @@ -0,0 +1,126 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'temporalio/client/interceptor'
         | 
| 4 | 
            +
            require 'temporalio/client/schedule'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            module Temporalio
         | 
| 7 | 
            +
              class Client
         | 
| 8 | 
            +
                # Handle for interacting with a schedule. This is usually created via {Client.create_schedule} or
         | 
| 9 | 
            +
                # {Client.schedule_handle}.
         | 
| 10 | 
            +
                class ScheduleHandle
         | 
| 11 | 
            +
                  # @return [String] ID of the schedule.
         | 
| 12 | 
            +
                  attr_reader :id
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                  # @!visibility private
         | 
| 15 | 
            +
                  def initialize(client:, id:)
         | 
| 16 | 
            +
                    @client = client
         | 
| 17 | 
            +
                    @id = id
         | 
| 18 | 
            +
                  end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                  # Backfill the schedule by going through the specified time periods as if they passed right now.
         | 
| 21 | 
            +
                  #
         | 
| 22 | 
            +
                  # @param backfills [Array<Schedule::Backfill>] Backfill periods.
         | 
| 23 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 24 | 
            +
                  #
         | 
| 25 | 
            +
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 26 | 
            +
                  def backfill(
         | 
| 27 | 
            +
                    *backfills,
         | 
| 28 | 
            +
                    rpc_options: nil
         | 
| 29 | 
            +
                  )
         | 
| 30 | 
            +
                    raise ArgumentError, 'At least one backfill required' if backfills.empty?
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                    @client._impl.backfill_schedule(Interceptor::BackfillScheduleInput.new(
         | 
| 33 | 
            +
                                                      id:,
         | 
| 34 | 
            +
                                                      backfills:,
         | 
| 35 | 
            +
                                                      rpc_options:
         | 
| 36 | 
            +
                                                    ))
         | 
| 37 | 
            +
                  end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                  # Delete this schedule.
         | 
| 40 | 
            +
                  #
         | 
| 41 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 42 | 
            +
                  #
         | 
| 43 | 
            +
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 44 | 
            +
                  def delete(rpc_options: nil)
         | 
| 45 | 
            +
                    @client._impl.delete_schedule(Interceptor::DeleteScheduleInput.new(
         | 
| 46 | 
            +
                                                    id:,
         | 
| 47 | 
            +
                                                    rpc_options:
         | 
| 48 | 
            +
                                                  ))
         | 
| 49 | 
            +
                  end
         | 
| 50 | 
            +
             | 
| 51 | 
            +
                  # Fetch this schedule's description.
         | 
| 52 | 
            +
                  #
         | 
| 53 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 54 | 
            +
                  #
         | 
| 55 | 
            +
                  # @return [Schedule::Description] Schedule description.
         | 
| 56 | 
            +
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 57 | 
            +
                  def describe(rpc_options: nil)
         | 
| 58 | 
            +
                    @client._impl.describe_schedule(Interceptor::DescribeScheduleInput.new(
         | 
| 59 | 
            +
                                                      id:,
         | 
| 60 | 
            +
                                                      rpc_options:
         | 
| 61 | 
            +
                                                    ))
         | 
| 62 | 
            +
                  end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                  # Pause the schedule and set a note.
         | 
| 65 | 
            +
                  #
         | 
| 66 | 
            +
                  # @param note [String] Note to set on the schedule.
         | 
| 67 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 68 | 
            +
                  #
         | 
| 69 | 
            +
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 70 | 
            +
                  def pause(note: 'Paused via Ruby SDK', rpc_options: nil)
         | 
| 71 | 
            +
                    @client._impl.pause_schedule(Interceptor::PauseScheduleInput.new(
         | 
| 72 | 
            +
                                                   id:,
         | 
| 73 | 
            +
                                                   note:,
         | 
| 74 | 
            +
                                                   rpc_options:
         | 
| 75 | 
            +
                                                 ))
         | 
| 76 | 
            +
                  end
         | 
| 77 | 
            +
             | 
| 78 | 
            +
                  # Trigger an action on this schedule to happen immediately.
         | 
| 79 | 
            +
                  #
         | 
| 80 | 
            +
                  # @param overlap [Schedule::OverlapPolicy, nil] If set, overrides the schedule's overlap policy.
         | 
| 81 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 82 | 
            +
                  #
         | 
| 83 | 
            +
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 84 | 
            +
                  def trigger(overlap: nil, rpc_options: nil)
         | 
| 85 | 
            +
                    @client._impl.trigger_schedule(Interceptor::TriggerScheduleInput.new(
         | 
| 86 | 
            +
                                                     id:,
         | 
| 87 | 
            +
                                                     overlap:,
         | 
| 88 | 
            +
                                                     rpc_options:
         | 
| 89 | 
            +
                                                   ))
         | 
| 90 | 
            +
                  end
         | 
| 91 | 
            +
             | 
| 92 | 
            +
                  # Unpause the schedule and set a note.
         | 
| 93 | 
            +
                  #
         | 
| 94 | 
            +
                  # @param note [String] Note to set on the schedule.
         | 
| 95 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 96 | 
            +
                  #
         | 
| 97 | 
            +
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 98 | 
            +
                  def unpause(note: 'Unpaused via Ruby SDK', rpc_options: nil)
         | 
| 99 | 
            +
                    @client._impl.unpause_schedule(Interceptor::UnpauseScheduleInput.new(
         | 
| 100 | 
            +
                                                     id:,
         | 
| 101 | 
            +
                                                     note:,
         | 
| 102 | 
            +
                                                     rpc_options:
         | 
| 103 | 
            +
                                                   ))
         | 
| 104 | 
            +
                  end
         | 
| 105 | 
            +
             | 
| 106 | 
            +
                  # Update a schedule using a callback to build the update from the description.
         | 
| 107 | 
            +
                  #
         | 
| 108 | 
            +
                  # NOTE: In future versions, the callback may be invoked multiple times in a conflict-resolution loop.
         | 
| 109 | 
            +
                  #
         | 
| 110 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 111 | 
            +
                  # @yield Block called to obtain the update.
         | 
| 112 | 
            +
                  # @yieldparam [Schedule::Update::Input] Parameter to the block that contains a description with the schedule to be
         | 
| 113 | 
            +
                  #   updated.
         | 
| 114 | 
            +
                  # @yieldreturn [Schedule::Update, nil] The update to apply, or `nil` to not perform an update.
         | 
| 115 | 
            +
                  #
         | 
| 116 | 
            +
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 117 | 
            +
                  def update(rpc_options: nil, &updater)
         | 
| 118 | 
            +
                    @client._impl.update_schedule(Interceptor::UpdateScheduleInput.new(
         | 
| 119 | 
            +
                                                    id:,
         | 
| 120 | 
            +
                                                    updater:,
         | 
| 121 | 
            +
                                                    rpc_options:
         | 
| 122 | 
            +
                                                  ))
         | 
| 123 | 
            +
                  end
         | 
| 124 | 
            +
                end
         | 
| 125 | 
            +
              end
         | 
| 126 | 
            +
            end
         | 
| @@ -0,0 +1,115 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'temporalio/common_enums'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            module Temporalio
         | 
| 6 | 
            +
              class Client
         | 
| 7 | 
            +
                # Start operation used by {Client.start_update_with_start_workflow}, {Client.execute_update_with_start_workflow},
         | 
| 8 | 
            +
                # and {Client.signal_with_start_workflow}.
         | 
| 9 | 
            +
                class WithStartWorkflowOperation
         | 
| 10 | 
            +
                  Options = Data.define(
         | 
| 11 | 
            +
                    :workflow,
         | 
| 12 | 
            +
                    :args,
         | 
| 13 | 
            +
                    :id,
         | 
| 14 | 
            +
                    :task_queue,
         | 
| 15 | 
            +
                    :static_summary,
         | 
| 16 | 
            +
                    :static_details,
         | 
| 17 | 
            +
                    :execution_timeout,
         | 
| 18 | 
            +
                    :run_timeout,
         | 
| 19 | 
            +
                    :task_timeout,
         | 
| 20 | 
            +
                    :id_reuse_policy,
         | 
| 21 | 
            +
                    :id_conflict_policy,
         | 
| 22 | 
            +
                    :retry_policy,
         | 
| 23 | 
            +
                    :cron_schedule,
         | 
| 24 | 
            +
                    :memo,
         | 
| 25 | 
            +
                    :search_attributes,
         | 
| 26 | 
            +
                    :start_delay,
         | 
| 27 | 
            +
                    :headers
         | 
| 28 | 
            +
                  )
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                  # Options the operation was created with.
         | 
| 31 | 
            +
                  class Options; end # rubocop:disable Lint/EmptyClass
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                  # @return [Options] Options the operation was created with.
         | 
| 34 | 
            +
                  attr_accessor :options
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                  # Create a with-start workflow operation. These are mostly the same options as {Client.start_workflow}, see that
         | 
| 37 | 
            +
                  # documentation for more details.
         | 
| 38 | 
            +
                  #
         | 
| 39 | 
            +
                  # Note, for {Client.start_update_with_start_workflow} and {Client.execute_update_with_start_workflow},
         | 
| 40 | 
            +
                  # `id_conflict_policy` is required.
         | 
| 41 | 
            +
                  def initialize(
         | 
| 42 | 
            +
                    workflow,
         | 
| 43 | 
            +
                    *args,
         | 
| 44 | 
            +
                    id:,
         | 
| 45 | 
            +
                    task_queue:,
         | 
| 46 | 
            +
                    static_summary: nil,
         | 
| 47 | 
            +
                    static_details: nil,
         | 
| 48 | 
            +
                    execution_timeout: nil,
         | 
| 49 | 
            +
                    run_timeout: nil,
         | 
| 50 | 
            +
                    task_timeout: nil,
         | 
| 51 | 
            +
                    id_reuse_policy: WorkflowIDReusePolicy::ALLOW_DUPLICATE,
         | 
| 52 | 
            +
                    id_conflict_policy: WorkflowIDConflictPolicy::UNSPECIFIED,
         | 
| 53 | 
            +
                    retry_policy: nil,
         | 
| 54 | 
            +
                    cron_schedule: nil,
         | 
| 55 | 
            +
                    memo: nil,
         | 
| 56 | 
            +
                    search_attributes: nil,
         | 
| 57 | 
            +
                    start_delay: nil,
         | 
| 58 | 
            +
                    headers: {}
         | 
| 59 | 
            +
                  )
         | 
| 60 | 
            +
                    @options = Options.new(
         | 
| 61 | 
            +
                      workflow: Workflow::Definition._workflow_type_from_workflow_parameter(workflow),
         | 
| 62 | 
            +
                      args:,
         | 
| 63 | 
            +
                      id:,
         | 
| 64 | 
            +
                      task_queue:,
         | 
| 65 | 
            +
                      static_summary:,
         | 
| 66 | 
            +
                      static_details:,
         | 
| 67 | 
            +
                      execution_timeout:,
         | 
| 68 | 
            +
                      run_timeout:,
         | 
| 69 | 
            +
                      task_timeout:,
         | 
| 70 | 
            +
                      id_reuse_policy:,
         | 
| 71 | 
            +
                      id_conflict_policy:,
         | 
| 72 | 
            +
                      retry_policy:,
         | 
| 73 | 
            +
                      cron_schedule:,
         | 
| 74 | 
            +
                      memo:,
         | 
| 75 | 
            +
                      search_attributes:,
         | 
| 76 | 
            +
                      start_delay:,
         | 
| 77 | 
            +
                      headers:
         | 
| 78 | 
            +
                    )
         | 
| 79 | 
            +
                    @workflow_handle_mutex = Mutex.new
         | 
| 80 | 
            +
                    @workflow_handle_cond_var = ConditionVariable.new
         | 
| 81 | 
            +
                  end
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                  # Get the workflow handle, possibly waiting until set, or raise an error if the workflow start was unsuccessful.
         | 
| 84 | 
            +
                  #
         | 
| 85 | 
            +
                  # @param wait [Boolean] True to wait until it is set, false to return immediately.
         | 
| 86 | 
            +
                  #
         | 
| 87 | 
            +
                  # @return [WorkflowHandle, nil] The workflow handle when available or `nil` if `wait` is false and it is not set
         | 
| 88 | 
            +
                  #   yet.
         | 
| 89 | 
            +
                  # @raise [Error] Any error that occurred during the call before the workflow start returned.
         | 
| 90 | 
            +
                  def workflow_handle(wait: true)
         | 
| 91 | 
            +
                    @workflow_handle_mutex.synchronize do
         | 
| 92 | 
            +
                      @workflow_handle_cond_var.wait(@workflow_handle_mutex) unless @workflow_handle || !wait
         | 
| 93 | 
            +
                      raise @workflow_handle if @workflow_handle.is_a?(Exception)
         | 
| 94 | 
            +
             | 
| 95 | 
            +
                      @workflow_handle
         | 
| 96 | 
            +
                    end
         | 
| 97 | 
            +
                  end
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                  # @!visibility private
         | 
| 100 | 
            +
                  def _set_workflow_handle(value)
         | 
| 101 | 
            +
                    @workflow_handle_mutex.synchronize do
         | 
| 102 | 
            +
                      @workflow_handle ||= value
         | 
| 103 | 
            +
                      @workflow_handle_cond_var.broadcast
         | 
| 104 | 
            +
                    end
         | 
| 105 | 
            +
                  end
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                  # @!visibility private
         | 
| 108 | 
            +
                  def _mark_used
         | 
| 109 | 
            +
                    raise 'Start operation already used' if @in_use
         | 
| 110 | 
            +
             | 
| 111 | 
            +
                    @in_use = true
         | 
| 112 | 
            +
                  end
         | 
| 113 | 
            +
                end
         | 
| 114 | 
            +
              end
         | 
| 115 | 
            +
            end
         | 
| @@ -15,17 +15,18 @@ module Temporalio | |
| 15 15 | 
             
                  # @!visibility private
         | 
| 16 16 | 
             
                  def initialize(raw_info, data_converter)
         | 
| 17 17 | 
             
                    @raw_info = raw_info
         | 
| 18 | 
            -
                    @ | 
| 18 | 
            +
                    @memo = Internal::ProtoUtils::LazyMemo.new(raw_info.memo, data_converter)
         | 
| 19 | 
            +
                    @search_attributes = Internal::ProtoUtils::LazySearchAttributes.new(raw_info.search_attributes)
         | 
| 19 20 | 
             
                  end
         | 
| 20 21 |  | 
| 21 22 | 
             
                  # @return [Time, nil] When the workflow was closed if closed.
         | 
| 22 23 | 
             
                  def close_time
         | 
| 23 | 
            -
                    @raw_info.close_time | 
| 24 | 
            +
                    Internal::ProtoUtils.timestamp_to_time(@raw_info.close_time)
         | 
| 24 25 | 
             
                  end
         | 
| 25 26 |  | 
| 26 27 | 
             
                  # @return [Time, nil] When this workflow run started or should start.
         | 
| 27 28 | 
             
                  def execution_time
         | 
| 28 | 
            -
                    @raw_info.execution_time | 
| 29 | 
            +
                    Internal::ProtoUtils.timestamp_to_time(@raw_info.execution_time)
         | 
| 29 30 | 
             
                  end
         | 
| 30 31 |  | 
| 31 32 | 
             
                  # @return [Integer] Number of events in the history.
         | 
| @@ -40,8 +41,7 @@ module Temporalio | |
| 40 41 |  | 
| 41 42 | 
             
                  # @return [Hash<String, Object>, nil] Memo for the workflow.
         | 
| 42 43 | 
             
                  def memo
         | 
| 43 | 
            -
                    @memo | 
| 44 | 
            -
                    @memo
         | 
| 44 | 
            +
                    @memo.get
         | 
| 45 45 | 
             
                  end
         | 
| 46 46 |  | 
| 47 47 | 
             
                  # @return [String, nil] ID for the parent workflow if this was started as a child.
         | 
| @@ -61,15 +61,12 @@ module Temporalio | |
| 61 61 |  | 
| 62 62 | 
             
                  # @return [SearchAttributes, nil] Current set of search attributes if any.
         | 
| 63 63 | 
             
                  def search_attributes
         | 
| 64 | 
            -
                     | 
| 65 | 
            -
                      @search_attributes = SearchAttributes.from_proto(@raw_info.search_attributes)
         | 
| 66 | 
            -
                    end
         | 
| 67 | 
            -
                    @search_attributes
         | 
| 64 | 
            +
                    @search_attributes.get
         | 
| 68 65 | 
             
                  end
         | 
| 69 66 |  | 
| 70 67 | 
             
                  # @return [Time] When the workflow was created.
         | 
| 71 68 | 
             
                  def start_time
         | 
| 72 | 
            -
                    @raw_info.start_time | 
| 69 | 
            +
                    Internal::ProtoUtils.timestamp_to_time(@raw_info.start_time) || raise # Never nil
         | 
| 73 70 | 
             
                  end
         | 
| 74 71 |  | 
| 75 72 | 
             
                  # @return [WorkflowExecutionStatus] Status for the workflow.
         | 
| @@ -96,6 +93,25 @@ module Temporalio | |
| 96 93 | 
             
                    def initialize(raw_description, data_converter)
         | 
| 97 94 | 
             
                      super(raw_description.workflow_execution_info, data_converter)
         | 
| 98 95 | 
             
                      @raw_description = raw_description
         | 
| 96 | 
            +
                      @data_converter = data_converter
         | 
| 97 | 
            +
                    end
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                    # @return [String, nil] Static summary configured on the workflow. This is currently experimental.
         | 
| 100 | 
            +
                    def static_summary
         | 
| 101 | 
            +
                      user_metadata.first
         | 
| 102 | 
            +
                    end
         | 
| 103 | 
            +
             | 
| 104 | 
            +
                    # @return [String, nil] Static details configured on the workflow. This is currently experimental.
         | 
| 105 | 
            +
                    def static_details
         | 
| 106 | 
            +
                      user_metadata.last
         | 
| 107 | 
            +
                    end
         | 
| 108 | 
            +
             | 
| 109 | 
            +
                    private
         | 
| 110 | 
            +
             | 
| 111 | 
            +
                    def user_metadata
         | 
| 112 | 
            +
                      @user_metadata ||= Internal::ProtoUtils.from_user_metadata(
         | 
| 113 | 
            +
                        @raw_description.execution_config&.user_metadata, @data_converter
         | 
| 114 | 
            +
                      )
         | 
| 99 115 | 
             
                    end
         | 
| 100 116 | 
             
                  end
         | 
| 101 117 | 
             
                end
         | 
| @@ -64,19 +64,14 @@ module Temporalio | |
| 64 64 | 
             
                  #
         | 
| 65 65 | 
             
                  # @param follow_runs [Boolean] If +true+, workflow runs will be continually fetched across retries and continue as
         | 
| 66 66 | 
             
                  #   new until the latest one is found. If +false+, the first result is used.
         | 
| 67 | 
            -
                  # @param  | 
| 68 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 67 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 69 68 | 
             
                  #
         | 
| 70 69 | 
             
                  # @return [Object] Result of the workflow after being converted by the data converter.
         | 
| 71 70 | 
             
                  #
         | 
| 72 71 | 
             
                  # @raise [Error::WorkflowFailedError] Workflow failed with +cause+ as the cause.
         | 
| 73 72 | 
             
                  # @raise [Error::WorkflowContinuedAsNewError] Workflow continued as new and +follow_runs+ is +false+.
         | 
| 74 73 | 
             
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 75 | 
            -
                  def result(
         | 
| 76 | 
            -
                    follow_runs: true,
         | 
| 77 | 
            -
                    rpc_metadata: nil,
         | 
| 78 | 
            -
                    rpc_timeout: nil
         | 
| 79 | 
            -
                  )
         | 
| 74 | 
            +
                  def result(follow_runs: true, rpc_options: nil)
         | 
| 80 75 | 
             
                    # Wait on the close event, following as needed
         | 
| 81 76 | 
             
                    hist_run_id = result_run_id
         | 
| 82 77 | 
             
                    loop do
         | 
| @@ -86,8 +81,7 @@ module Temporalio | |
| 86 81 | 
             
                        event_filter_type: Api::Enums::V1::HistoryEventFilterType::HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT,
         | 
| 87 82 | 
             
                        skip_archival: true,
         | 
| 88 83 | 
             
                        specific_run_id: hist_run_id,
         | 
| 89 | 
            -
                         | 
| 90 | 
            -
                        rpc_timeout:
         | 
| 84 | 
            +
                        rpc_options:
         | 
| 91 85 | 
             
                      ).next
         | 
| 92 86 |  | 
| 93 87 | 
             
                      # Check each close type'
         | 
| @@ -106,13 +100,13 @@ module Temporalio | |
| 106 100 | 
             
                        raise Error::WorkflowFailedError.new, cause: @client.data_converter.from_failure(attrs.failure)
         | 
| 107 101 | 
             
                      when :EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED
         | 
| 108 102 | 
             
                        attrs = event.workflow_execution_canceled_event_attributes
         | 
| 109 | 
            -
                        raise Error::WorkflowFailedError.new, cause: Error::CanceledError.new(
         | 
| 103 | 
            +
                        raise Error::WorkflowFailedError.new, 'Workflow execution canceled', cause: Error::CanceledError.new(
         | 
| 110 104 | 
             
                          'Workflow execution canceled',
         | 
| 111 105 | 
             
                          details: @client.data_converter.from_payloads(attrs&.details)
         | 
| 112 106 | 
             
                        )
         | 
| 113 107 | 
             
                      when :EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED
         | 
| 114 108 | 
             
                        attrs = event.workflow_execution_terminated_event_attributes
         | 
| 115 | 
            -
                        raise Error::WorkflowFailedError.new, cause: Error::TerminatedError.new(
         | 
| 109 | 
            +
                        raise Error::WorkflowFailedError.new, 'Workflow execution terminated', cause: Error::TerminatedError.new(
         | 
| 116 110 | 
             
                          Internal::ProtoUtils.string_or(attrs.reason, 'Workflow execution terminated'),
         | 
| 117 111 | 
             
                          details: @client.data_converter.from_payloads(attrs&.details)
         | 
| 118 112 | 
             
                        )
         | 
| @@ -121,7 +115,7 @@ module Temporalio | |
| 121 115 | 
             
                        hist_run_id = attrs.new_execution_run_id
         | 
| 122 116 | 
             
                        next if follow_runs && hist_run_id && !hist_run_id.empty?
         | 
| 123 117 |  | 
| 124 | 
            -
                        raise Error::WorkflowFailedError.new, cause: Error::TimeoutError.new(
         | 
| 118 | 
            +
                        raise Error::WorkflowFailedError.new, 'Workflow execution timed out', cause: Error::TimeoutError.new(
         | 
| 125 119 | 
             
                          'Workflow execution timed out',
         | 
| 126 120 | 
             
                          type: Api::Enums::V1::TimeoutType::TIMEOUT_TYPE_START_TO_CLOSE,
         | 
| 127 121 | 
             
                          last_heartbeat_details: []
         | 
| @@ -142,8 +136,7 @@ module Temporalio | |
| 142 136 | 
             
                  # Get workflow details. This will get details for the {run_id} if present. To use a different run ID, create a new
         | 
| 143 137 | 
             
                  # handle via {Client.workflow_handle}.
         | 
| 144 138 | 
             
                  #
         | 
| 145 | 
            -
                  # @param  | 
| 146 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 139 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 147 140 | 
             
                  #
         | 
| 148 141 | 
             
                  # @return [WorkflowExecution::Description] Workflow description.
         | 
| 149 142 | 
             
                  #
         | 
| @@ -151,15 +144,11 @@ module Temporalio | |
| 151 144 | 
             
                  #
         | 
| 152 145 | 
             
                  # @note Handles created as a result of {Client.start_workflow} will describe the latest workflow with the same
         | 
| 153 146 | 
             
                  #   workflow ID even if it is unrelated to the started workflow.
         | 
| 154 | 
            -
                  def describe(
         | 
| 155 | 
            -
                    rpc_metadata: nil,
         | 
| 156 | 
            -
                    rpc_timeout: nil
         | 
| 157 | 
            -
                  )
         | 
| 147 | 
            +
                  def describe(rpc_options: nil)
         | 
| 158 148 | 
             
                    @client._impl.describe_workflow(Interceptor::DescribeWorkflowInput.new(
         | 
| 159 149 | 
             
                                                      workflow_id: id,
         | 
| 160 150 | 
             
                                                      run_id:,
         | 
| 161 | 
            -
                                                       | 
| 162 | 
            -
                                                      rpc_timeout:
         | 
| 151 | 
            +
                                                      rpc_options:
         | 
| 163 152 | 
             
                                                    ))
         | 
| 164 153 | 
             
                  end
         | 
| 165 154 |  | 
| @@ -167,8 +156,7 @@ module Temporalio | |
| 167 156 | 
             
                  #
         | 
| 168 157 | 
             
                  # @param event_filter_type [Api::Enums::V1::HistoryEventFilterType] Types of events to fetch.
         | 
| 169 158 | 
             
                  # @param skip_archival [Boolean] Whether to skip archival.
         | 
| 170 | 
            -
                  # @param  | 
| 171 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 159 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 172 160 | 
             
                  #
         | 
| 173 161 | 
             
                  # @return [WorkflowHistory] Workflow history.
         | 
| 174 162 | 
             
                  #
         | 
| @@ -176,15 +164,13 @@ module Temporalio | |
| 176 164 | 
             
                  def fetch_history(
         | 
| 177 165 | 
             
                    event_filter_type: Api::Enums::V1::HistoryEventFilterType::HISTORY_EVENT_FILTER_TYPE_ALL_EVENT,
         | 
| 178 166 | 
             
                    skip_archival: false,
         | 
| 179 | 
            -
                     | 
| 180 | 
            -
                    rpc_timeout: nil
         | 
| 167 | 
            +
                    rpc_options: nil
         | 
| 181 168 | 
             
                  )
         | 
| 182 169 | 
             
                    WorkflowHistory.new(
         | 
| 183 170 | 
             
                      fetch_history_events(
         | 
| 184 171 | 
             
                        event_filter_type:,
         | 
| 185 172 | 
             
                        skip_archival:,
         | 
| 186 | 
            -
                         | 
| 187 | 
            -
                        rpc_timeout:
         | 
| 173 | 
            +
                        rpc_options:
         | 
| 188 174 | 
             
                      ).to_a
         | 
| 189 175 | 
             
                    )
         | 
| 190 176 | 
             
                  end
         | 
| @@ -199,8 +185,7 @@ module Temporalio | |
| 199 185 | 
             
                  # @param skip_archival [Boolean] Whether to skip archival.
         | 
| 200 186 | 
             
                  # @param specific_run_id [String, nil] Run ID to fetch events for. Default is the {run_id}. Most users will not
         | 
| 201 187 | 
             
                  #   need to set this and instead use the one on the class.
         | 
| 202 | 
            -
                  # @param  | 
| 203 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 188 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 204 189 | 
             
                  #
         | 
| 205 190 | 
             
                  # @return [Enumerator<Api::History::V1::HistoryEvent>] Enumerable events.
         | 
| 206 191 | 
             
                  #
         | 
| @@ -210,8 +195,7 @@ module Temporalio | |
| 210 195 | 
             
                    event_filter_type: Api::Enums::V1::HistoryEventFilterType::HISTORY_EVENT_FILTER_TYPE_ALL_EVENT,
         | 
| 211 196 | 
             
                    skip_archival: false,
         | 
| 212 197 | 
             
                    specific_run_id: run_id,
         | 
| 213 | 
            -
                     | 
| 214 | 
            -
                    rpc_timeout: nil
         | 
| 198 | 
            +
                    rpc_options: nil
         | 
| 215 199 | 
             
                  )
         | 
| 216 200 | 
             
                    @client._impl.fetch_workflow_history_events(Interceptor::FetchWorkflowHistoryEventsInput.new(
         | 
| 217 201 | 
             
                                                                  workflow_id: id,
         | 
| @@ -219,48 +203,39 @@ module Temporalio | |
| 219 203 | 
             
                                                                  wait_new_event:,
         | 
| 220 204 | 
             
                                                                  event_filter_type:,
         | 
| 221 205 | 
             
                                                                  skip_archival:,
         | 
| 222 | 
            -
                                                                   | 
| 223 | 
            -
                                                                  rpc_timeout:
         | 
| 206 | 
            +
                                                                  rpc_options:
         | 
| 224 207 | 
             
                                                                ))
         | 
| 225 208 | 
             
                  end
         | 
| 226 209 |  | 
| 227 210 | 
             
                  # Send a signal to the workflow. This will signal for {run_id} if present. To use a different run ID, create a new
         | 
| 228 211 | 
             
                  # handle via {Client.workflow_handle}.
         | 
| 229 212 | 
             
                  #
         | 
| 230 | 
            -
                  # @param signal [String] Signal name.
         | 
| 213 | 
            +
                  # @param signal [Workflow::Definition::Signal, Symbol, String] Signal definition or name.
         | 
| 231 214 | 
             
                  # @param args [Array<Object>] Signal arguments.
         | 
| 232 | 
            -
                  # @param  | 
| 233 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 215 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 234 216 | 
             
                  #
         | 
| 235 217 | 
             
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 236 218 | 
             
                  #
         | 
| 237 219 | 
             
                  # @note Handles created as a result of {Client.start_workflow} will signal the latest workflow with the same
         | 
| 238 220 | 
             
                  #   workflow ID even if it is unrelated to the started workflow.
         | 
| 239 | 
            -
                  def signal(
         | 
| 240 | 
            -
                    signal,
         | 
| 241 | 
            -
                    *args,
         | 
| 242 | 
            -
                    rpc_metadata: nil,
         | 
| 243 | 
            -
                    rpc_timeout: nil
         | 
| 244 | 
            -
                  )
         | 
| 221 | 
            +
                  def signal(signal, *args, rpc_options: nil)
         | 
| 245 222 | 
             
                    @client._impl.signal_workflow(Interceptor::SignalWorkflowInput.new(
         | 
| 246 223 | 
             
                                                    workflow_id: id,
         | 
| 247 224 | 
             
                                                    run_id:,
         | 
| 248 | 
            -
                                                    signal | 
| 225 | 
            +
                                                    signal: Workflow::Definition::Signal._name_from_parameter(signal),
         | 
| 249 226 | 
             
                                                    args:,
         | 
| 250 227 | 
             
                                                    headers: {},
         | 
| 251 | 
            -
                                                     | 
| 252 | 
            -
                                                    rpc_timeout:
         | 
| 228 | 
            +
                                                    rpc_options:
         | 
| 253 229 | 
             
                                                  ))
         | 
| 254 230 | 
             
                  end
         | 
| 255 231 |  | 
| 256 232 | 
             
                  # Query the workflow. This will query for {run_id} if present. To use a different run ID, create a new handle via
         | 
| 257 233 | 
             
                  # {Client.workflow_handle}.
         | 
| 258 234 | 
             
                  #
         | 
| 259 | 
            -
                  # @param query [String] Query name.
         | 
| 235 | 
            +
                  # @param query [Workflow::Definition::Query, Symbol, String] Query definition or name.
         | 
| 260 236 | 
             
                  # @param args [Array<Object>] Query arguments.
         | 
| 261 237 | 
             
                  # @param reject_condition [WorkflowQueryRejectCondition, nil] Condition for rejecting the query.
         | 
| 262 | 
            -
                  # @param  | 
| 263 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 238 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 264 239 | 
             
                  #
         | 
| 265 240 | 
             
                  # @return [Object, nil] Query result.
         | 
| 266 241 | 
             
                  #
         | 
| @@ -274,31 +249,28 @@ module Temporalio | |
| 274 249 | 
             
                    query,
         | 
| 275 250 | 
             
                    *args,
         | 
| 276 251 | 
             
                    reject_condition: @client.options.default_workflow_query_reject_condition,
         | 
| 277 | 
            -
                     | 
| 278 | 
            -
                    rpc_timeout: nil
         | 
| 252 | 
            +
                    rpc_options: nil
         | 
| 279 253 | 
             
                  )
         | 
| 280 254 | 
             
                    @client._impl.query_workflow(Interceptor::QueryWorkflowInput.new(
         | 
| 281 255 | 
             
                                                   workflow_id: id,
         | 
| 282 256 | 
             
                                                   run_id:,
         | 
| 283 | 
            -
                                                   query | 
| 257 | 
            +
                                                   query: Workflow::Definition::Query._name_from_parameter(query),
         | 
| 284 258 | 
             
                                                   args:,
         | 
| 285 259 | 
             
                                                   reject_condition:,
         | 
| 286 260 | 
             
                                                   headers: {},
         | 
| 287 | 
            -
                                                    | 
| 288 | 
            -
                                                   rpc_timeout:
         | 
| 261 | 
            +
                                                   rpc_options:
         | 
| 289 262 | 
             
                                                 ))
         | 
| 290 263 | 
             
                  end
         | 
| 291 264 |  | 
| 292 265 | 
             
                  # Send an update request to the workflow and return a handle to it. This will target the workflow with {run_id} if
         | 
| 293 266 | 
             
                  # present. To use a different run ID, create a new handle via {Client.workflow_handle}.
         | 
| 294 267 | 
             
                  #
         | 
| 295 | 
            -
                  # @param update [String] Update name.
         | 
| 268 | 
            +
                  # @param update [Workflow::Definition::Update, Symbol, String] Update definition or name.
         | 
| 296 269 | 
             
                  # @param args [Array<Object>] Update arguments.
         | 
| 297 270 | 
             
                  # @param wait_for_stage [WorkflowUpdateWaitStage] Required stage to wait until returning. ADMITTED is not
         | 
| 298 271 | 
             
                  #   currently supported. See https://docs.temporal.io/workflows#update for more details.
         | 
| 299 272 | 
             
                  # @param id [String] ID of the update.
         | 
| 300 | 
            -
                  # @param  | 
| 301 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 273 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 302 274 | 
             
                  #
         | 
| 303 275 | 
             
                  # @return [WorkflowUpdateHandle] The update handle.
         | 
| 304 276 | 
             
                  #
         | 
| @@ -308,36 +280,32 @@ module Temporalio | |
| 308 280 | 
             
                  #
         | 
| 309 281 | 
             
                  # @note Handles created as a result of {Client.start_workflow} will send updates the latest workflow with the same
         | 
| 310 282 | 
             
                  #   workflow ID even if it is unrelated to the started workflow.
         | 
| 311 | 
            -
                  # @note WARNING: This API is experimental.
         | 
| 312 283 | 
             
                  def start_update(
         | 
| 313 284 | 
             
                    update,
         | 
| 314 285 | 
             
                    *args,
         | 
| 315 286 | 
             
                    wait_for_stage:,
         | 
| 316 287 | 
             
                    id: SecureRandom.uuid,
         | 
| 317 | 
            -
                     | 
| 318 | 
            -
                    rpc_timeout: nil
         | 
| 288 | 
            +
                    rpc_options: nil
         | 
| 319 289 | 
             
                  )
         | 
| 320 290 | 
             
                    @client._impl.start_workflow_update(Interceptor::StartWorkflowUpdateInput.new(
         | 
| 321 291 | 
             
                                                          workflow_id: self.id,
         | 
| 322 292 | 
             
                                                          run_id:,
         | 
| 323 293 | 
             
                                                          update_id: id,
         | 
| 324 | 
            -
                                                          update | 
| 294 | 
            +
                                                          update: Workflow::Definition::Update._name_from_parameter(update),
         | 
| 325 295 | 
             
                                                          args:,
         | 
| 326 296 | 
             
                                                          wait_for_stage:,
         | 
| 327 297 | 
             
                                                          headers: {},
         | 
| 328 | 
            -
                                                           | 
| 329 | 
            -
                                                          rpc_timeout:
         | 
| 298 | 
            +
                                                          rpc_options:
         | 
| 330 299 | 
             
                                                        ))
         | 
| 331 300 | 
             
                  end
         | 
| 332 301 |  | 
| 333 302 | 
             
                  # Send an update request to the workflow and wait for it to complete. This will target the workflow with {run_id}
         | 
| 334 303 | 
             
                  # if present. To use a different run ID, create a new handle via {Client.workflow_handle}.
         | 
| 335 304 | 
             
                  #
         | 
| 336 | 
            -
                  # @param update [String] Update name.
         | 
| 305 | 
            +
                  # @param update [Workflow::Definition::Update, Symbol, String] Update definition or name.
         | 
| 337 306 | 
             
                  # @param args [Array<Object>] Update arguments.
         | 
| 338 307 | 
             
                  # @param id [String] ID of the update.
         | 
| 339 | 
            -
                  # @param  | 
| 340 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 308 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 341 309 | 
             
                  #
         | 
| 342 310 | 
             
                  # @return [Object, nil] Update result.
         | 
| 343 311 | 
             
                  #
         | 
| @@ -348,21 +316,13 @@ module Temporalio | |
| 348 316 | 
             
                  #
         | 
| 349 317 | 
             
                  # @note Handles created as a result of {Client.start_workflow} will send updates the latest workflow with the same
         | 
| 350 318 | 
             
                  #   workflow ID even if it is unrelated to the started workflow.
         | 
| 351 | 
            -
                   | 
| 352 | 
            -
                  def execute_update(
         | 
| 353 | 
            -
                    update,
         | 
| 354 | 
            -
                    *args,
         | 
| 355 | 
            -
                    id: SecureRandom.uuid,
         | 
| 356 | 
            -
                    rpc_metadata: nil,
         | 
| 357 | 
            -
                    rpc_timeout: nil
         | 
| 358 | 
            -
                  )
         | 
| 319 | 
            +
                  def execute_update(update, *args, id: SecureRandom.uuid, rpc_options: nil)
         | 
| 359 320 | 
             
                    start_update(
         | 
| 360 321 | 
             
                      update,
         | 
| 361 322 | 
             
                      *args,
         | 
| 362 323 | 
             
                      wait_for_stage: WorkflowUpdateWaitStage::COMPLETED,
         | 
| 363 324 | 
             
                      id:,
         | 
| 364 | 
            -
                       | 
| 365 | 
            -
                      rpc_timeout:
         | 
| 325 | 
            +
                      rpc_options:
         | 
| 366 326 | 
             
                    ).result
         | 
| 367 327 | 
             
                  end
         | 
| 368 328 |  | 
| @@ -373,12 +333,7 @@ module Temporalio | |
| 373 333 | 
             
                  #   users will not need to set this and instead use the one on the class.
         | 
| 374 334 | 
             
                  #
         | 
| 375 335 | 
             
                  # @return [WorkflowUpdateHandle] The update handle.
         | 
| 376 | 
            -
                   | 
| 377 | 
            -
                  # @note WARNING: This API is experimental.
         | 
| 378 | 
            -
                  def update_handle(
         | 
| 379 | 
            -
                    id,
         | 
| 380 | 
            -
                    specific_run_id: run_id
         | 
| 381 | 
            -
                  )
         | 
| 336 | 
            +
                  def update_handle(id, specific_run_id: run_id)
         | 
| 382 337 | 
             
                    WorkflowUpdateHandle.new(
         | 
| 383 338 | 
             
                      client: @client,
         | 
| 384 339 | 
             
                      id:,
         | 
| @@ -392,23 +347,18 @@ module Temporalio | |
| 392 347 | 
             
                  # run chain starting from {first_execution_run_id} if present. To create handles with these values, use
         | 
| 393 348 | 
             
                  # {Client.workflow_handle}.
         | 
| 394 349 | 
             
                  #
         | 
| 395 | 
            -
                  # @param  | 
| 396 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 350 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 397 351 | 
             
                  #
         | 
| 398 352 | 
             
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 399 353 | 
             
                  #
         | 
| 400 354 | 
             
                  # @note Handles created as a result of signal with start will cancel the latest workflow with the same workflow ID
         | 
| 401 355 | 
             
                  #   even if it is unrelated to the started workflow.
         | 
| 402 | 
            -
                  def cancel(
         | 
| 403 | 
            -
                    rpc_metadata: nil,
         | 
| 404 | 
            -
                    rpc_timeout: nil
         | 
| 405 | 
            -
                  )
         | 
| 356 | 
            +
                  def cancel(rpc_options: nil)
         | 
| 406 357 | 
             
                    @client._impl.cancel_workflow(Interceptor::CancelWorkflowInput.new(
         | 
| 407 358 | 
             
                                                    workflow_id: id,
         | 
| 408 359 | 
             
                                                    run_id:,
         | 
| 409 360 | 
             
                                                    first_execution_run_id:,
         | 
| 410 | 
            -
                                                     | 
| 411 | 
            -
                                                    rpc_timeout:
         | 
| 361 | 
            +
                                                    rpc_options:
         | 
| 412 362 | 
             
                                                  ))
         | 
| 413 363 | 
             
                  end
         | 
| 414 364 |  | 
| @@ -418,27 +368,20 @@ module Temporalio | |
| 418 368 | 
             
                  #
         | 
| 419 369 | 
             
                  # @param reason [String, nil] Reason for the termination.
         | 
| 420 370 | 
             
                  # @param details [Array<Object>] Details to store on the termination.
         | 
| 421 | 
            -
                  # @param  | 
| 422 | 
            -
                  # @param rpc_timeout [Float, nil] Number of seconds before timeout.
         | 
| 371 | 
            +
                  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
         | 
| 423 372 | 
             
                  #
         | 
| 424 373 | 
             
                  # @raise [Error::RPCError] RPC error from call.
         | 
| 425 374 | 
             
                  #
         | 
| 426 375 | 
             
                  # @note Handles created as a result of signal with start will terminate the latest workflow with the same workflow
         | 
| 427 376 | 
             
                  #   ID even if it is unrelated to the started workflow.
         | 
| 428 | 
            -
                  def terminate(
         | 
| 429 | 
            -
                    reason = nil,
         | 
| 430 | 
            -
                    details: [],
         | 
| 431 | 
            -
                    rpc_metadata: nil,
         | 
| 432 | 
            -
                    rpc_timeout: nil
         | 
| 433 | 
            -
                  )
         | 
| 377 | 
            +
                  def terminate(reason = nil, details: [], rpc_options: nil)
         | 
| 434 378 | 
             
                    @client._impl.terminate_workflow(Interceptor::TerminateWorkflowInput.new(
         | 
| 435 379 | 
             
                                                       workflow_id: id,
         | 
| 436 380 | 
             
                                                       run_id:,
         | 
| 437 381 | 
             
                                                       first_execution_run_id:,
         | 
| 438 382 | 
             
                                                       reason:,
         | 
| 439 383 | 
             
                                                       details:,
         | 
| 440 | 
            -
                                                        | 
| 441 | 
            -
                                                       rpc_timeout:
         | 
| 384 | 
            +
                                                       rpc_options:
         | 
| 442 385 | 
             
                                                     ))
         | 
| 443 386 | 
             
                  end
         | 
| 444 387 | 
             
                end
         |