temporalio 0.3.0-aarch64-linux → 0.5.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 +1 -1
- data/Gemfile +4 -0
- data/Rakefile +1 -1
- data/lib/temporalio/activity/cancellation_details.rb +58 -0
- data/lib/temporalio/activity/context.rb +23 -1
- data/lib/temporalio/activity/definition.rb +63 -8
- data/lib/temporalio/activity/info.rb +28 -4
- data/lib/temporalio/activity.rb +2 -0
- data/lib/temporalio/api/activity/v1/message.rb +1 -1
- data/lib/temporalio/api/batch/v1/message.rb +9 -2
- data/lib/temporalio/api/cloud/account/v1/message.rb +1 -1
- data/lib/temporalio/api/cloud/cloudservice/v1/request_response.rb +11 -2
- data/lib/temporalio/api/cloud/cloudservice/v1/service.rb +2 -2
- data/lib/temporalio/api/cloud/identity/v1/message.rb +7 -2
- data/lib/temporalio/api/cloud/namespace/v1/message.rb +6 -2
- data/lib/temporalio/api/cloud/nexus/v1/message.rb +3 -2
- data/lib/temporalio/api/cloud/operation/v1/message.rb +1 -1
- data/lib/temporalio/api/cloud/region/v1/message.rb +1 -1
- data/lib/temporalio/api/cloud/resource/v1/message.rb +1 -1
- data/lib/temporalio/api/cloud/sink/v1/message.rb +1 -1
- data/lib/temporalio/api/cloud/usage/v1/message.rb +1 -1
- data/lib/temporalio/api/command/v1/message.rb +2 -2
- data/lib/temporalio/api/common/v1/grpc_status.rb +1 -1
- data/lib/temporalio/api/common/v1/message.rb +4 -2
- data/lib/temporalio/api/deployment/v1/message.rb +39 -0
- data/lib/temporalio/api/enums/v1/batch_operation.rb +2 -2
- data/lib/temporalio/api/enums/v1/command_type.rb +1 -1
- data/lib/temporalio/api/enums/v1/common.rb +5 -2
- data/lib/temporalio/api/enums/v1/deployment.rb +24 -0
- data/lib/temporalio/api/enums/v1/event_type.rb +2 -2
- data/lib/temporalio/api/enums/v1/failed_cause.rb +2 -2
- data/lib/temporalio/api/enums/v1/namespace.rb +1 -1
- data/lib/temporalio/api/enums/v1/nexus.rb +21 -0
- data/lib/temporalio/api/enums/v1/query.rb +1 -1
- data/lib/temporalio/api/enums/v1/reset.rb +2 -2
- data/lib/temporalio/api/enums/v1/schedule.rb +1 -1
- data/lib/temporalio/api/enums/v1/task_queue.rb +1 -1
- data/lib/temporalio/api/enums/v1/update.rb +1 -1
- data/lib/temporalio/api/enums/v1/workflow.rb +3 -2
- data/lib/temporalio/api/errordetails/v1/message.rb +4 -2
- data/lib/temporalio/api/export/v1/message.rb +1 -1
- data/lib/temporalio/api/failure/v1/message.rb +5 -2
- data/lib/temporalio/api/filter/v1/message.rb +1 -1
- data/lib/temporalio/api/history/v1/message.rb +6 -2
- data/lib/temporalio/api/namespace/v1/message.rb +1 -1
- data/lib/temporalio/api/nexus/v1/message.rb +3 -2
- data/lib/temporalio/api/operatorservice/v1/request_response.rb +1 -1
- data/lib/temporalio/api/operatorservice/v1/service.rb +1 -1
- data/lib/temporalio/api/payload_visitor.rb +162 -7
- data/lib/temporalio/api/protocol/v1/message.rb +1 -1
- data/lib/temporalio/api/query/v1/message.rb +3 -2
- data/lib/temporalio/api/replication/v1/message.rb +1 -1
- data/lib/temporalio/api/rules/v1/message.rb +27 -0
- data/lib/temporalio/api/schedule/v1/message.rb +2 -2
- data/lib/temporalio/api/sdk/v1/enhanced_stack_trace.rb +1 -1
- data/lib/temporalio/api/sdk/v1/task_complete_metadata.rb +1 -1
- data/lib/temporalio/api/sdk/v1/user_metadata.rb +1 -1
- data/lib/temporalio/api/sdk/v1/workflow_metadata.rb +1 -1
- data/lib/temporalio/api/taskqueue/v1/message.rb +5 -2
- data/lib/temporalio/api/testservice/v1/request_response.rb +1 -1
- data/lib/temporalio/api/testservice/v1/service.rb +1 -1
- data/lib/temporalio/api/update/v1/message.rb +1 -1
- data/lib/temporalio/api/version/v1/message.rb +1 -1
- data/lib/temporalio/api/worker/v1/message.rb +30 -0
- data/lib/temporalio/api/workflow/v1/message.rb +22 -2
- data/lib/temporalio/api/workflowservice/v1/request_response.rb +58 -12
- data/lib/temporalio/api/workflowservice/v1/service.rb +2 -2
- data/lib/temporalio/api.rb +1 -0
- data/lib/temporalio/client/async_activity_handle.rb +12 -4
- data/lib/temporalio/client/connection/cloud_service.rb +60 -0
- data/lib/temporalio/client/connection/workflow_service.rb +343 -28
- data/lib/temporalio/client/interceptor.rb +64 -7
- data/lib/temporalio/client/schedule.rb +35 -3
- data/lib/temporalio/client/with_start_workflow_operation.rb +123 -0
- data/lib/temporalio/client/workflow_execution.rb +19 -0
- data/lib/temporalio/client/workflow_handle.rb +47 -7
- data/lib/temporalio/client/workflow_update_handle.rb +9 -3
- data/lib/temporalio/client.rb +231 -4
- data/lib/temporalio/common_enums.rb +14 -0
- data/lib/temporalio/contrib/open_telemetry.rb +474 -0
- data/lib/temporalio/converters/data_converter.rb +18 -8
- data/lib/temporalio/converters/failure_converter.rb +6 -3
- data/lib/temporalio/converters/payload_converter/binary_null.rb +2 -2
- data/lib/temporalio/converters/payload_converter/binary_plain.rb +2 -2
- data/lib/temporalio/converters/payload_converter/binary_protobuf.rb +2 -2
- data/lib/temporalio/converters/payload_converter/composite.rb +6 -4
- data/lib/temporalio/converters/payload_converter/encoding.rb +4 -2
- data/lib/temporalio/converters/payload_converter/json_plain.rb +2 -2
- data/lib/temporalio/converters/payload_converter/json_protobuf.rb +2 -2
- data/lib/temporalio/converters/payload_converter.rb +16 -6
- data/lib/temporalio/error/failure.rb +19 -1
- data/lib/temporalio/error.rb +2 -1
- 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.4/temporalio_bridge.so +0 -0
- data/lib/temporalio/internal/bridge/api/activity_result/activity_result.rb +1 -1
- data/lib/temporalio/internal/bridge/api/activity_task/activity_task.rb +3 -2
- data/lib/temporalio/internal/bridge/api/child_workflow/child_workflow.rb +1 -1
- data/lib/temporalio/internal/bridge/api/common/common.rb +3 -2
- data/lib/temporalio/internal/bridge/api/core_interface.rb +1 -1
- data/lib/temporalio/internal/bridge/api/external_data/external_data.rb +1 -1
- data/lib/temporalio/internal/bridge/api/nexus/nexus.rb +3 -2
- data/lib/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rb +2 -2
- data/lib/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rb +3 -2
- data/lib/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rb +3 -2
- data/lib/temporalio/internal/bridge/runtime.rb +3 -0
- data/lib/temporalio/internal/bridge/testing.rb +3 -0
- data/lib/temporalio/internal/bridge/worker.rb +28 -4
- data/lib/temporalio/internal/bridge.rb +1 -1
- data/lib/temporalio/internal/client/implementation.rb +281 -51
- data/lib/temporalio/internal/proto_utils.rb +38 -6
- data/lib/temporalio/internal/worker/activity_worker.rb +112 -27
- data/lib/temporalio/internal/worker/multi_runner.rb +2 -2
- data/lib/temporalio/internal/worker/workflow_instance/child_workflow_handle.rb +8 -6
- data/lib/temporalio/internal/worker/workflow_instance/context.rb +100 -5
- data/lib/temporalio/internal/worker/workflow_instance/details.rb +7 -2
- data/lib/temporalio/internal/worker/workflow_instance/external_workflow_handle.rb +2 -2
- data/lib/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rb +64 -18
- data/lib/temporalio/internal/worker/workflow_instance/outbound_implementation.rb +39 -40
- data/lib/temporalio/internal/worker/workflow_instance/scheduler.rb +22 -2
- data/lib/temporalio/internal/worker/workflow_instance.rb +134 -55
- data/lib/temporalio/internal/worker/workflow_worker.rb +74 -21
- data/lib/temporalio/priority.rb +59 -0
- data/lib/temporalio/runtime/metric_buffer.rb +94 -0
- data/lib/temporalio/runtime.rb +48 -10
- data/lib/temporalio/search_attributes.rb +13 -0
- data/lib/temporalio/testing/activity_environment.rb +59 -16
- data/lib/temporalio/testing/workflow_environment.rb +29 -6
- data/lib/temporalio/version.rb +1 -1
- data/lib/temporalio/versioning_override.rb +56 -0
- data/lib/temporalio/worker/deployment_options.rb +45 -0
- data/lib/temporalio/worker/illegal_workflow_call_validator.rb +64 -0
- data/lib/temporalio/worker/interceptor.rb +16 -1
- data/lib/temporalio/worker/poller_behavior.rb +61 -0
- data/lib/temporalio/worker/thread_pool.rb +6 -6
- data/lib/temporalio/worker/tuner.rb +38 -0
- data/lib/temporalio/worker/workflow_executor/thread_pool.rb +14 -8
- data/lib/temporalio/worker/workflow_executor.rb +1 -1
- data/lib/temporalio/worker/workflow_replayer.rb +349 -0
- data/lib/temporalio/worker.rb +117 -75
- data/lib/temporalio/worker_deployment_version.rb +67 -0
- data/lib/temporalio/workflow/child_workflow_handle.rb +10 -2
- data/lib/temporalio/workflow/definition.rb +217 -35
- data/lib/temporalio/workflow/external_workflow_handle.rb +3 -1
- data/lib/temporalio/workflow/future.rb +2 -2
- data/lib/temporalio/workflow/info.rb +26 -1
- data/lib/temporalio/workflow.rb +119 -15
- data/lib/temporalio/workflow_history.rb +26 -1
- data/lib/temporalio.rb +1 -0
- data/temporalio.gemspec +3 -1
- metadata +34 -4
| @@ -1,5 +1,6 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            +
            require 'temporalio/worker/illegal_workflow_call_validator'
         | 
| 3 4 | 
             
            require 'temporalio/workflow'
         | 
| 4 5 |  | 
| 5 6 | 
             
            module Temporalio
         | 
| @@ -12,16 +13,32 @@ module Temporalio | |
| 12 13 | 
             
                        illegal_calls.to_h do |key, val|
         | 
| 13 14 | 
             
                          raise TypeError, 'Invalid illegal call map, top-level key must be a String' unless key.is_a?(String)
         | 
| 14 15 |  | 
| 15 | 
            -
                          # @type var fixed_val: :all | Hash[Symbol,  | 
| 16 | 
            +
                          # @type var fixed_val: :all | Worker::IllegalWorkflowCallValidator | Hash[Symbol, TrueClass | Worker::IllegalWorkflowCallValidator] # rubocop:disable Layout/LineLength
         | 
| 16 17 | 
             
                          fixed_val = case val
         | 
| 18 | 
            +
                                      when Temporalio::Worker::IllegalWorkflowCallValidator
         | 
| 19 | 
            +
                                        if sub_val.method_name
         | 
| 20 | 
            +
                                          raise ArgumentError,
         | 
| 21 | 
            +
                                                'Top level IllegalWorkflowCallValidator instances cannot have method name'
         | 
| 22 | 
            +
                                        end
         | 
| 23 | 
            +
                                        val
         | 
| 17 24 | 
             
                                      when Array
         | 
| 18 25 | 
             
                                        val.to_h do |sub_val|
         | 
| 19 | 
            -
                                           | 
| 26 | 
            +
                                          case sub_val
         | 
| 27 | 
            +
                                          when Symbol
         | 
| 28 | 
            +
                                            [sub_val, true]
         | 
| 29 | 
            +
                                          when Temporalio::Worker::IllegalWorkflowCallValidator
         | 
| 30 | 
            +
                                            unless sub_val.method_name
         | 
| 31 | 
            +
                                              raise ArgumentError,
         | 
| 32 | 
            +
                                                    'IllegalWorkflowCallValidator instances in array for ' \
         | 
| 33 | 
            +
                                                    "#{key} must have a method name"
         | 
| 34 | 
            +
                                            end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                                            [sub_val.method_name, sub_val]
         | 
| 37 | 
            +
                                          else
         | 
| 20 38 | 
             
                                            raise TypeError,
         | 
| 21 | 
            -
                                                  'Invalid illegal call  | 
| 39 | 
            +
                                                  'Invalid illegal call array entry for ' \
         | 
| 40 | 
            +
                                                  "#{key}, each value must be a Symbol or an IllegalWorkflowCallValidator"
         | 
| 22 41 | 
             
                                          end
         | 
| 23 | 
            -
             | 
| 24 | 
            -
                                          [sub_val, true]
         | 
| 25 42 | 
             
                                        end.freeze
         | 
| 26 43 | 
             
                                      when :all
         | 
| 27 44 | 
             
                                        :all
         | 
| @@ -47,25 +64,54 @@ module Temporalio | |
| 47 64 | 
             
                          # class of things like `Date` does not have `attached_object` so you have to fall back in these rare cases
         | 
| 48 65 | 
             
                          # to parsing the string output. Reaching the string parsing component is rare, so this should not have
         | 
| 49 66 | 
             
                          # significant performance impact.
         | 
| 50 | 
            -
                           | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 67 | 
            +
                          class_name = if cls.singleton_class?
         | 
| 68 | 
            +
                                         if cls.respond_to?(:attached_object)
         | 
| 69 | 
            +
                                           cls = cls.attached_object # steep:ignore
         | 
| 70 | 
            +
                                           next unless cls.is_a?(Module)
         | 
| 54 71 |  | 
| 55 | 
            -
             | 
| 72 | 
            +
                                           cls.name.to_s
         | 
| 73 | 
            +
                                         else
         | 
| 74 | 
            +
                                           cls.to_s.delete_prefix('#<Class:').delete_suffix('>')
         | 
| 75 | 
            +
                                         end
         | 
| 56 76 | 
             
                                       else
         | 
| 57 | 
            -
                                         cls.to_s | 
| 77 | 
            +
                                         cls.name.to_s
         | 
| 58 78 | 
             
                                       end
         | 
| 59 | 
            -
                                     else
         | 
| 60 | 
            -
                                       cls.name.to_s
         | 
| 61 | 
            -
                                     end
         | 
| 62 79 |  | 
| 63 80 | 
             
                          # Check if the call is considered illegal
         | 
| 64 | 
            -
                          vals = illegal_calls[ | 
| 65 | 
            -
                           | 
| 81 | 
            +
                          vals = illegal_calls[class_name]
         | 
| 82 | 
            +
                          invalid_suffix =
         | 
| 83 | 
            +
                            case vals
         | 
| 84 | 
            +
                            when :all
         | 
| 85 | 
            +
                              ''
         | 
| 86 | 
            +
                            when Temporalio::Worker::IllegalWorkflowCallValidator
         | 
| 87 | 
            +
                              disable do
         | 
| 88 | 
            +
                                vals.block.call(Temporalio::Worker::IllegalWorkflowCallValidator::CallInfo.new(
         | 
| 89 | 
            +
                                                  class_name:, method_name: tp.callee_id, trace_point: tp
         | 
| 90 | 
            +
                                                ))
         | 
| 91 | 
            +
                                nil
         | 
| 92 | 
            +
                              rescue Exception => e # rubocop:disable Lint/RescueException
         | 
| 93 | 
            +
                                ", reason: #{e}"
         | 
| 94 | 
            +
                              end
         | 
| 95 | 
            +
                            else
         | 
| 96 | 
            +
                              per_method = vals&.[](tp.callee_id)
         | 
| 97 | 
            +
                              case per_method
         | 
| 98 | 
            +
                              when true
         | 
| 99 | 
            +
                                ''
         | 
| 100 | 
            +
                              when Temporalio::Worker::IllegalWorkflowCallValidator
         | 
| 101 | 
            +
                                disable do
         | 
| 102 | 
            +
                                  per_method.block.call(Temporalio::Worker::IllegalWorkflowCallValidator::CallInfo.new(
         | 
| 103 | 
            +
                                                          class_name:, method_name: tp.callee_id, trace_point: tp
         | 
| 104 | 
            +
                                                        ))
         | 
| 105 | 
            +
                                  nil
         | 
| 106 | 
            +
                                rescue Exception => e # rubocop:disable Lint/RescueException
         | 
| 107 | 
            +
                                  ", reason: #{e}"
         | 
| 108 | 
            +
                                end
         | 
| 109 | 
            +
                              end
         | 
| 110 | 
            +
                            end
         | 
| 111 | 
            +
                          if invalid_suffix
         | 
| 66 112 | 
             
                            raise Workflow::NondeterminismError,
         | 
| 67 | 
            -
                                  "Cannot access #{ | 
| 68 | 
            -
                                   | 
| 113 | 
            +
                                  "Cannot access #{class_name} #{tp.callee_id} from inside a " \
         | 
| 114 | 
            +
                                  "workflow#{invalid_suffix}. If this is known to be safe, the code can be run in " \
         | 
| 69 115 | 
             
                                  'a Temporalio::Workflow::Unsafe.illegal_call_tracing_disabled block.'
         | 
| 70 116 | 
             
                          end
         | 
| 71 117 | 
             
                        end
         | 
| @@ -56,35 +56,30 @@ module Temporalio | |
| 56 56 | 
             
                          raise ArgumentError, 'Activity must have schedule_to_close_timeout or start_to_close_timeout'
         | 
| 57 57 | 
             
                        end
         | 
| 58 58 |  | 
| 59 | 
            -
                         | 
| 60 | 
            -
             | 
| 61 | 
            -
                                          Activity::Definition::Info.from_activity(input.activity).name
         | 
| 62 | 
            -
                                        when Symbol, String
         | 
| 63 | 
            -
                                          input.activity.to_s
         | 
| 64 | 
            -
                                        else
         | 
| 65 | 
            -
                                          raise ArgumentError, 'Activity must be a definition class, or a symbol/string'
         | 
| 66 | 
            -
                                        end
         | 
| 67 | 
            -
                        raise 'Cannot invoke dynamic activities' unless activity_type
         | 
| 68 | 
            -
             | 
| 69 | 
            -
                        execute_activity_with_local_backoffs(local: false, cancellation: input.cancellation) do
         | 
| 59 | 
            +
                        execute_activity_with_local_backoffs(local: false, cancellation: input.cancellation,
         | 
| 60 | 
            +
                                                             result_hint: input.result_hint) do
         | 
| 70 61 | 
             
                          seq = (@activity_counter += 1)
         | 
| 71 62 | 
             
                          @instance.add_command(
         | 
| 72 63 | 
             
                            Bridge::Api::WorkflowCommands::WorkflowCommand.new(
         | 
| 73 64 | 
             
                              schedule_activity: Bridge::Api::WorkflowCommands::ScheduleActivity.new(
         | 
| 74 65 | 
             
                                seq:,
         | 
| 75 66 | 
             
                                activity_id: input.activity_id || seq.to_s,
         | 
| 76 | 
            -
                                activity_type | 
| 67 | 
            +
                                activity_type: input.activity,
         | 
| 77 68 | 
             
                                task_queue: input.task_queue,
         | 
| 78 69 | 
             
                                headers: ProtoUtils.headers_to_proto_hash(input.headers, @instance.payload_converter),
         | 
| 79 | 
            -
                                arguments: ProtoUtils.convert_to_payload_array( | 
| 70 | 
            +
                                arguments: ProtoUtils.convert_to_payload_array(
         | 
| 71 | 
            +
                                  @instance.payload_converter, input.args, hints: input.arg_hints
         | 
| 72 | 
            +
                                ),
         | 
| 80 73 | 
             
                                schedule_to_close_timeout: ProtoUtils.seconds_to_duration(input.schedule_to_close_timeout),
         | 
| 81 74 | 
             
                                schedule_to_start_timeout: ProtoUtils.seconds_to_duration(input.schedule_to_start_timeout),
         | 
| 82 75 | 
             
                                start_to_close_timeout: ProtoUtils.seconds_to_duration(input.start_to_close_timeout),
         | 
| 83 76 | 
             
                                heartbeat_timeout: ProtoUtils.seconds_to_duration(input.heartbeat_timeout),
         | 
| 84 77 | 
             
                                retry_policy: input.retry_policy&._to_proto,
         | 
| 85 78 | 
             
                                cancellation_type: input.cancellation_type,
         | 
| 86 | 
            -
                                do_not_eagerly_execute: input.disable_eager_execution
         | 
| 87 | 
            -
             | 
| 79 | 
            +
                                do_not_eagerly_execute: input.disable_eager_execution,
         | 
| 80 | 
            +
                                priority: input.priority._to_proto
         | 
| 81 | 
            +
                              ),
         | 
| 82 | 
            +
                              user_metadata: ProtoUtils.to_user_metadata(input.summary, nil, @instance.payload_converter)
         | 
| 88 83 | 
             
                            )
         | 
| 89 84 | 
             
                          )
         | 
| 90 85 | 
             
                          seq
         | 
| @@ -96,26 +91,21 @@ module Temporalio | |
| 96 91 | 
             
                          raise ArgumentError, 'Activity must have schedule_to_close_timeout or start_to_close_timeout'
         | 
| 97 92 | 
             
                        end
         | 
| 98 93 |  | 
| 99 | 
            -
                         | 
| 100 | 
            -
             | 
| 101 | 
            -
             | 
| 102 | 
            -
             | 
| 103 | 
            -
                                          input.activity.to_s
         | 
| 104 | 
            -
                                        else
         | 
| 105 | 
            -
                                          raise ArgumentError, 'Activity must be a definition class, or a symbol/string'
         | 
| 106 | 
            -
                                        end
         | 
| 107 | 
            -
                        raise 'Cannot invoke dynamic activities' unless activity_type
         | 
| 108 | 
            -
             | 
| 109 | 
            -
                        execute_activity_with_local_backoffs(local: true, cancellation: input.cancellation) do |do_backoff|
         | 
| 94 | 
            +
                        @instance.assert_valid_local_activity.call(input.activity)
         | 
| 95 | 
            +
             | 
| 96 | 
            +
                        execute_activity_with_local_backoffs(local: true, cancellation: input.cancellation,
         | 
| 97 | 
            +
                                                             result_hint: input.result_hint) do |do_backoff|
         | 
| 110 98 | 
             
                          seq = (@activity_counter += 1)
         | 
| 111 99 | 
             
                          @instance.add_command(
         | 
| 112 100 | 
             
                            Bridge::Api::WorkflowCommands::WorkflowCommand.new(
         | 
| 113 101 | 
             
                              schedule_local_activity: Bridge::Api::WorkflowCommands::ScheduleLocalActivity.new(
         | 
| 114 102 | 
             
                                seq:,
         | 
| 115 103 | 
             
                                activity_id: input.activity_id || seq.to_s,
         | 
| 116 | 
            -
                                activity_type | 
| 104 | 
            +
                                activity_type: input.activity,
         | 
| 117 105 | 
             
                                headers: ProtoUtils.headers_to_proto_hash(input.headers, @instance.payload_converter),
         | 
| 118 | 
            -
                                arguments: ProtoUtils.convert_to_payload_array( | 
| 106 | 
            +
                                arguments: ProtoUtils.convert_to_payload_array(
         | 
| 107 | 
            +
                                  @instance.payload_converter, input.args, hints: input.arg_hints
         | 
| 108 | 
            +
                                ),
         | 
| 119 109 | 
             
                                schedule_to_close_timeout: ProtoUtils.seconds_to_duration(input.schedule_to_close_timeout),
         | 
| 120 110 | 
             
                                schedule_to_start_timeout: ProtoUtils.seconds_to_duration(input.schedule_to_start_timeout),
         | 
| 121 111 | 
             
                                start_to_close_timeout: ProtoUtils.seconds_to_duration(input.start_to_close_timeout),
         | 
| @@ -131,7 +121,7 @@ module Temporalio | |
| 131 121 | 
             
                        end
         | 
| 132 122 | 
             
                      end
         | 
| 133 123 |  | 
| 134 | 
            -
                      def execute_activity_with_local_backoffs(local:, cancellation:, &)
         | 
| 124 | 
            +
                      def execute_activity_with_local_backoffs(local:, cancellation:, result_hint:, &)
         | 
| 135 125 | 
             
                        # We do not even want to schedule if the cancellation is already cancelled. We choose to use canceled
         | 
| 136 126 | 
             
                        # failure instead of wrapping in activity failure which is similar to what other SDKs do, with the accepted
         | 
| 137 127 | 
             
                        # tradeoff that it makes rescue more difficult (hence the presence of Error.canceled? helper).
         | 
| @@ -140,7 +130,7 @@ module Temporalio | |
| 140 130 | 
             
                        # This has to be done in a loop for local activity backoff
         | 
| 141 131 | 
             
                        last_local_backoff = nil
         | 
| 142 132 | 
             
                        loop do
         | 
| 143 | 
            -
                          result = execute_activity_once(local:, cancellation:, last_local_backoff:, &)
         | 
| 133 | 
            +
                          result = execute_activity_once(local:, cancellation:, last_local_backoff:, result_hint:, &)
         | 
| 144 134 | 
             
                          return result unless result.is_a?(Bridge::Api::ActivityResult::DoBackoff)
         | 
| 145 135 |  | 
| 146 136 | 
             
                          # @type var result: untyped
         | 
| @@ -152,7 +142,7 @@ module Temporalio | |
| 152 142 | 
             
                      end
         | 
| 153 143 |  | 
| 154 144 | 
             
                      # If this doesn't raise, it returns success | DoBackoff
         | 
| 155 | 
            -
                      def execute_activity_once(local:, cancellation:, last_local_backoff:, &)
         | 
| 145 | 
            +
                      def execute_activity_once(local:, cancellation:, last_local_backoff:, result_hint:, &)
         | 
| 156 146 | 
             
                        # Add to pending activities (removed by the resolver)
         | 
| 157 147 | 
             
                        seq = yield last_local_backoff
         | 
| 158 148 | 
             
                        @instance.pending_activities[seq] = Fiber.current
         | 
| @@ -185,7 +175,7 @@ module Temporalio | |
| 185 175 |  | 
| 186 176 | 
             
                        case resolution.status
         | 
| 187 177 | 
             
                        when :completed
         | 
| 188 | 
            -
                          @instance.payload_converter.from_payload(resolution.completed.result)
         | 
| 178 | 
            +
                          @instance.payload_converter.from_payload(resolution.completed.result, hint: result_hint)
         | 
| 189 179 | 
             
                        when :failed
         | 
| 190 180 | 
             
                          raise @instance.failure_converter.from_failure(resolution.failed.failure, @instance.payload_converter)
         | 
| 191 181 | 
             
                        when :cancelled
         | 
| @@ -209,6 +199,7 @@ module Temporalio | |
| 209 199 | 
             
                          signal: input.signal,
         | 
| 210 200 | 
             
                          args: input.args,
         | 
| 211 201 | 
             
                          cancellation: input.cancellation,
         | 
| 202 | 
            +
                          arg_hints: input.arg_hints,
         | 
| 212 203 | 
             
                          headers: input.headers
         | 
| 213 204 | 
             
                        )
         | 
| 214 205 | 
             
                      end
         | 
| @@ -221,19 +212,20 @@ module Temporalio | |
| 221 212 | 
             
                          signal: input.signal,
         | 
| 222 213 | 
             
                          args: input.args,
         | 
| 223 214 | 
             
                          cancellation: input.cancellation,
         | 
| 215 | 
            +
                          arg_hints: input.arg_hints,
         | 
| 224 216 | 
             
                          headers: input.headers
         | 
| 225 217 | 
             
                        )
         | 
| 226 218 | 
             
                      end
         | 
| 227 219 |  | 
| 228 | 
            -
                      def _signal_external_workflow(id:, run_id:, child:, signal:, args:, cancellation:, headers:)
         | 
| 220 | 
            +
                      def _signal_external_workflow(id:, run_id:, child:, signal:, args:, cancellation:, arg_hints:, headers:)
         | 
| 229 221 | 
             
                        raise Error::CanceledError, 'Signal canceled before scheduled' if cancellation.canceled?
         | 
| 230 222 |  | 
| 231 223 | 
             
                        # Add command
         | 
| 232 224 | 
             
                        seq = (@external_signal_counter += 1)
         | 
| 233 225 | 
             
                        cmd = Bridge::Api::WorkflowCommands::SignalExternalWorkflowExecution.new(
         | 
| 234 226 | 
             
                          seq:,
         | 
| 235 | 
            -
                          signal_name:  | 
| 236 | 
            -
                          args: ProtoUtils.convert_to_payload_array(@instance.payload_converter, args),
         | 
| 227 | 
            +
                          signal_name: signal,
         | 
| 228 | 
            +
                          args: ProtoUtils.convert_to_payload_array(@instance.payload_converter, args, hints: arg_hints),
         | 
| 237 229 | 
             
                          headers: ProtoUtils.headers_to_proto_hash(headers, @instance.payload_converter)
         | 
| 238 230 | 
             
                        )
         | 
| 239 231 | 
             
                        if child
         | 
| @@ -300,7 +292,8 @@ module Temporalio | |
| 300 292 | 
             
                            start_timer: Bridge::Api::WorkflowCommands::StartTimer.new(
         | 
| 301 293 | 
             
                              seq:,
         | 
| 302 294 | 
             
                              start_to_fire_timeout: ProtoUtils.seconds_to_duration(duration)
         | 
| 303 | 
            -
                            )
         | 
| 295 | 
            +
                            ),
         | 
| 296 | 
            +
                            user_metadata: ProtoUtils.to_user_metadata(input.summary, nil, @instance.payload_converter)
         | 
| 304 297 | 
             
                          )
         | 
| 305 298 | 
             
                        )
         | 
| 306 299 | 
             
                        @instance.pending_timers[seq] = Fiber.current
         | 
| @@ -340,9 +333,10 @@ module Temporalio | |
| 340 333 | 
             
                              seq:,
         | 
| 341 334 | 
             
                              namespace: @instance.info.namespace,
         | 
| 342 335 | 
             
                              workflow_id: input.id,
         | 
| 343 | 
            -
                              workflow_type:  | 
| 336 | 
            +
                              workflow_type: input.workflow,
         | 
| 344 337 | 
             
                              task_queue: input.task_queue,
         | 
| 345 | 
            -
                              input: ProtoUtils.convert_to_payload_array(@instance.payload_converter, input.args | 
| 338 | 
            +
                              input: ProtoUtils.convert_to_payload_array(@instance.payload_converter, input.args,
         | 
| 339 | 
            +
                                                                         hints: input.arg_hints),
         | 
| 346 340 | 
             
                              workflow_execution_timeout: ProtoUtils.seconds_to_duration(input.execution_timeout),
         | 
| 347 341 | 
             
                              workflow_run_timeout: ProtoUtils.seconds_to_duration(input.run_timeout),
         | 
| 348 342 | 
             
                              workflow_task_timeout: ProtoUtils.seconds_to_duration(input.task_timeout),
         | 
| @@ -353,7 +347,11 @@ module Temporalio | |
| 353 347 | 
             
                              headers: ProtoUtils.headers_to_proto_hash(input.headers, @instance.payload_converter),
         | 
| 354 348 | 
             
                              memo: ProtoUtils.memo_to_proto_hash(input.memo, @instance.payload_converter),
         | 
| 355 349 | 
             
                              search_attributes: input.search_attributes&._to_proto_hash,
         | 
| 356 | 
            -
                              cancellation_type: input.cancellation_type
         | 
| 350 | 
            +
                              cancellation_type: input.cancellation_type,
         | 
| 351 | 
            +
                              priority: input.priority._to_proto
         | 
| 352 | 
            +
                            ),
         | 
| 353 | 
            +
                            user_metadata: ProtoUtils.to_user_metadata(
         | 
| 354 | 
            +
                              input.static_summary, input.static_details, @instance.payload_converter
         | 
| 357 355 | 
             
                            )
         | 
| 358 356 | 
             
                          )
         | 
| 359 357 | 
             
                        )
         | 
| @@ -385,7 +383,8 @@ module Temporalio | |
| 385 383 | 
             
                            first_execution_run_id: resolution.succeeded.run_id,
         | 
| 386 384 | 
             
                            instance: @instance,
         | 
| 387 385 | 
             
                            cancellation: input.cancellation,
         | 
| 388 | 
            -
                            cancel_callback_key | 
| 386 | 
            +
                            cancel_callback_key:,
         | 
| 387 | 
            +
                            result_hint: input.result_hint
         | 
| 389 388 | 
             
                          )
         | 
| 390 389 | 
             
                          @instance.pending_child_workflows[seq] = handle
         | 
| 391 390 | 
             
                          handle
         | 
| @@ -137,8 +137,28 @@ module Temporalio | |
| 137 137 | 
             
                      end
         | 
| 138 138 |  | 
| 139 139 | 
             
                      def io_wait(io, events, timeout)
         | 
| 140 | 
            -
                        #  | 
| 141 | 
            -
                         | 
| 140 | 
            +
                        # Do not allow if IO disabled
         | 
| 141 | 
            +
                        unless @instance.io_enabled
         | 
| 142 | 
            +
                          raise Workflow::NondeterminismError,
         | 
| 143 | 
            +
                                'Cannot perform IO from inside a workflow. If this is known to be safe, ' \
         | 
| 144 | 
            +
                                'the code can be run in a Temporalio::Workflow::Unsafe.io_enabled block.'
         | 
| 145 | 
            +
                        end
         | 
| 146 | 
            +
             | 
| 147 | 
            +
                        # Use regular Ruby behavior of blocking this thread. There is no Ruby implementation of io_wait we can just
         | 
| 148 | 
            +
                        # delegate to at this time (or default scheduler or anything like that), so we had to implement this
         | 
| 149 | 
            +
                        # ourselves.
         | 
| 150 | 
            +
                        readers = events.nobits?(IO::READABLE) ? nil : [io]
         | 
| 151 | 
            +
                        writers = events.nobits?(IO::WRITABLE) ? nil : [io]
         | 
| 152 | 
            +
                        priority = events.nobits?(IO::PRIORITY) ? nil : [io]
         | 
| 153 | 
            +
                        ready = IO.select(readers, writers, priority, timeout) # steep:ignore
         | 
| 154 | 
            +
             | 
| 155 | 
            +
                        result = 0
         | 
| 156 | 
            +
                        unless ready.nil?
         | 
| 157 | 
            +
                          result |= IO::READABLE if ready[0]&.include?(io)
         | 
| 158 | 
            +
                          result |= IO::WRITABLE if ready[1]&.include?(io)
         | 
| 159 | 
            +
                          result |= IO::PRIORITY if ready[2]&.include?(io)
         | 
| 160 | 
            +
                        end
         | 
| 161 | 
            +
                        result
         | 
| 142 162 | 
             
                      end
         | 
| 143 163 |  | 
| 144 164 | 
             
                      def kernel_sleep(duration = nil)
         |