temporalio 0.3.0-x86_64-linux-musl → 0.4.0-x86_64-linux-musl
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/Gemfile +4 -0
- data/Rakefile +1 -1
- data/lib/temporalio/activity/context.rb +7 -0
- data/lib/temporalio/activity/definition.rb +4 -1
- data/lib/temporalio/activity/info.rb +3 -0
- data/lib/temporalio/api/batch/v1/message.rb +6 -1
- data/lib/temporalio/api/command/v1/message.rb +1 -1
- data/lib/temporalio/api/common/v1/message.rb +2 -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 +2 -1
- data/lib/temporalio/api/payload_visitor.rb +75 -7
- data/lib/temporalio/api/query/v1/message.rb +2 -1
- data/lib/temporalio/api/taskqueue/v1/message.rb +4 -1
- data/lib/temporalio/api/workflow/v1/message.rb +9 -1
- data/lib/temporalio/api/workflowservice/v1/request_response.rb +40 -11
- data/lib/temporalio/api/workflowservice/v1/service.rb +1 -1
- data/lib/temporalio/api.rb +1 -0
- data/lib/temporalio/client/connection/workflow_service.rb +238 -28
- data/lib/temporalio/client/interceptor.rb +39 -0
- data/lib/temporalio/client/schedule.rb +25 -1
- data/lib/temporalio/client/with_start_workflow_operation.rb +115 -0
- data/lib/temporalio/client/workflow_execution.rb +19 -0
- data/lib/temporalio/client/workflow_handle.rb +3 -3
- data/lib/temporalio/client.rb +125 -2
- data/lib/temporalio/contrib/open_telemetry.rb +470 -0
- data/lib/temporalio/error.rb +1 -0
- 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_task/activity_task.rb +1 -1
- data/lib/temporalio/internal/bridge/api/common/common.rb +2 -1
- data/lib/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rb +1 -1
- data/lib/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rb +1 -1
- data/lib/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rb +2 -1
- data/lib/temporalio/internal/bridge/runtime.rb +3 -0
- data/lib/temporalio/internal/bridge/testing.rb +3 -0
- data/lib/temporalio/internal/client/implementation.rb +232 -10
- data/lib/temporalio/internal/proto_utils.rb +34 -2
- data/lib/temporalio/internal/worker/activity_worker.rb +14 -5
- data/lib/temporalio/internal/worker/multi_runner.rb +2 -2
- data/lib/temporalio/internal/worker/workflow_instance/context.rb +53 -3
- data/lib/temporalio/internal/worker/workflow_instance/details.rb +4 -2
- data/lib/temporalio/internal/worker/workflow_instance/outbound_implementation.rb +11 -26
- data/lib/temporalio/internal/worker/workflow_instance/scheduler.rb +22 -2
- data/lib/temporalio/internal/worker/workflow_instance.rb +76 -32
- data/lib/temporalio/internal/worker/workflow_worker.rb +6 -3
- 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 +32 -8
- data/lib/temporalio/testing/workflow_environment.rb +26 -3
- data/lib/temporalio/version.rb +1 -1
- data/lib/temporalio/worker/interceptor.rb +3 -0
- data/lib/temporalio/worker/thread_pool.rb +5 -5
- data/lib/temporalio/worker/workflow_executor/thread_pool.rb +8 -3
- data/lib/temporalio/worker/workflow_replayer.rb +7 -0
- data/lib/temporalio/worker.rb +34 -0
- data/lib/temporalio/workflow/definition.rb +40 -8
- data/lib/temporalio/workflow/future.rb +2 -2
- data/lib/temporalio/workflow/info.rb +22 -0
- data/lib/temporalio/workflow.rb +54 -8
- data/temporalio.gemspec +2 -1
- metadata +24 -4
| @@ -0,0 +1,94 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Temporalio
         | 
| 4 | 
            +
              class Runtime
         | 
| 5 | 
            +
                # Metric buffer for use with a runtime to capture metrics. Only one metric buffer can be associated with a runtime
         | 
| 6 | 
            +
                # and {retrieve_updates} cannot be called before the runtime is created. Once runtime created, users should
         | 
| 7 | 
            +
                # regularly call {retrieve_updates} to drain the buffer.
         | 
| 8 | 
            +
                #
         | 
| 9 | 
            +
                # @note WARNING: It is important that the buffer size is set to a high number and that {retrieve_updates} is called
         | 
| 10 | 
            +
                #   regularly to drain the buffer. If the buffer is full, metric updates will be dropped and an error will be
         | 
| 11 | 
            +
                #   logged.
         | 
| 12 | 
            +
                class MetricBuffer
         | 
| 13 | 
            +
                  # Enumerates for the duration format.
         | 
| 14 | 
            +
                  module DurationFormat
         | 
| 15 | 
            +
                    # Durations are millisecond integers.
         | 
| 16 | 
            +
                    MILLISECONDS = :milliseconds
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                    # Durations are second floats.
         | 
| 19 | 
            +
                    SECONDS = :seconds
         | 
| 20 | 
            +
                  end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                  Update = Data.define(:metric, :value, :attributes)
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                  # Metric buffer update.
         | 
| 25 | 
            +
                  #
         | 
| 26 | 
            +
                  # @note WARNING: The constructor of this class should not be invoked by users and may change in incompatible ways
         | 
| 27 | 
            +
                  #   in the future.
         | 
| 28 | 
            +
                  #
         | 
| 29 | 
            +
                  # @!attribute metric
         | 
| 30 | 
            +
                  #   @return [Metric] Metric for this update. For performance reasons, this is created lazily on first use and is
         | 
| 31 | 
            +
                  #     the same object each time an update on this metric exists.
         | 
| 32 | 
            +
                  # @!attribute value
         | 
| 33 | 
            +
                  #   @return [Integer, Float] Metric value for this update.
         | 
| 34 | 
            +
                  # @!attribute attributes
         | 
| 35 | 
            +
                  #   @return [Hash{String => String, Integer, Float, Boolean}] Attributes for this value as a frozen hash.
         | 
| 36 | 
            +
                  #     For performance reasons this is sometimes the same hash if the attribute set is reused at a metric level.
         | 
| 37 | 
            +
                  class Update # rubocop:disable Lint/EmptyClass
         | 
| 38 | 
            +
                    # DEV NOTE: This class is instantiated inside Rust, be careful changing it.
         | 
| 39 | 
            +
                  end
         | 
| 40 | 
            +
             | 
| 41 | 
            +
                  Metric = Data.define(:name, :description, :unit, :kind)
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                  # Metric definition present on an update.
         | 
| 44 | 
            +
                  #
         | 
| 45 | 
            +
                  # @!attribute name
         | 
| 46 | 
            +
                  #   @return [String] Name of the metric.
         | 
| 47 | 
            +
                  # @!attribute description
         | 
| 48 | 
            +
                  #   @return [String, nil] Description of the metric if any.
         | 
| 49 | 
            +
                  # @!attribute unit
         | 
| 50 | 
            +
                  #   @return [String, nil] Unit of the metric if any.
         | 
| 51 | 
            +
                  # @!attribute kind
         | 
| 52 | 
            +
                  #   @return [:counter, :histogram, :gauge] Kind of the metric.
         | 
| 53 | 
            +
                  class Metric # rubocop:disable Lint/EmptyClass
         | 
| 54 | 
            +
                    # DEV NOTE: This class is instantiated inside Rust, be careful changing it.
         | 
| 55 | 
            +
                  end
         | 
| 56 | 
            +
             | 
| 57 | 
            +
                  # Create a metric buffer with the given size.
         | 
| 58 | 
            +
                  #
         | 
| 59 | 
            +
                  # @note WARNING: It is important that the buffer size is set to a high number and is drained regularly. See
         | 
| 60 | 
            +
                  #   {MetricBuffer} warning.
         | 
| 61 | 
            +
                  #
         | 
| 62 | 
            +
                  # @param buffer_size [Integer] Maximum size of the buffer before metrics will be dropped.
         | 
| 63 | 
            +
                  # @param duration_format [DurationFormat] How durations are represented.
         | 
| 64 | 
            +
                  def initialize(buffer_size, duration_format: DurationFormat::MILLISECONDS)
         | 
| 65 | 
            +
                    @buffer_size = buffer_size
         | 
| 66 | 
            +
                    @duration_format = duration_format
         | 
| 67 | 
            +
                    @runtime = nil
         | 
| 68 | 
            +
                  end
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                  # Drain the buffer and return all metric updates.
         | 
| 71 | 
            +
                  #
         | 
| 72 | 
            +
                  # @note WARNING: It is important that this is called regularly. See {MetricBuffer} warning.
         | 
| 73 | 
            +
                  #
         | 
| 74 | 
            +
                  # @return [Array<Update>] Updates since last time this was called.
         | 
| 75 | 
            +
                  def retrieve_updates
         | 
| 76 | 
            +
                    raise 'Attempting to retrieve updates before runtime created' unless @runtime
         | 
| 77 | 
            +
             | 
| 78 | 
            +
                    @runtime._core_runtime.retrieve_buffered_metrics(@duration_format == DurationFormat::SECONDS)
         | 
| 79 | 
            +
                  end
         | 
| 80 | 
            +
             | 
| 81 | 
            +
                  # @!visibility private
         | 
| 82 | 
            +
                  def _buffer_size
         | 
| 83 | 
            +
                    @buffer_size
         | 
| 84 | 
            +
                  end
         | 
| 85 | 
            +
             | 
| 86 | 
            +
                  # @!visibility private
         | 
| 87 | 
            +
                  def _set_runtime(runtime)
         | 
| 88 | 
            +
                    raise 'Metric buffer already attached to a runtime' if @runtime
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                    @runtime = runtime
         | 
| 91 | 
            +
                  end
         | 
| 92 | 
            +
                end
         | 
| 93 | 
            +
              end
         | 
| 94 | 
            +
            end
         | 
    
        data/lib/temporalio/runtime.rb
    CHANGED
    
    | @@ -4,6 +4,7 @@ require 'temporalio/internal/bridge' | |
| 4 4 | 
             
            require 'temporalio/internal/bridge/runtime'
         | 
| 5 5 | 
             
            require 'temporalio/internal/metric'
         | 
| 6 6 | 
             
            require 'temporalio/metric'
         | 
| 7 | 
            +
            require 'temporalio/runtime/metric_buffer'
         | 
| 7 8 |  | 
| 8 9 | 
             
            module Temporalio
         | 
| 9 10 | 
             
              # Runtime for Temporal Ruby SDK.
         | 
| @@ -107,6 +108,7 @@ module Temporalio | |
| 107 108 | 
             
                MetricsOptions = Data.define(
         | 
| 108 109 | 
             
                  :opentelemetry,
         | 
| 109 110 | 
             
                  :prometheus,
         | 
| 111 | 
            +
                  :buffer,
         | 
| 110 112 | 
             
                  :attach_service_name,
         | 
| 111 113 | 
             
                  :global_tags,
         | 
| 112 114 | 
             
                  :metric_prefix
         | 
| @@ -116,10 +118,13 @@ module Temporalio | |
| 116 118 | 
             
                #
         | 
| 117 119 | 
             
                # @!attribute opentelemetry
         | 
| 118 120 | 
             
                #   @return [OpenTelemetryMetricsOptions, nil] OpenTelemetry options if using OpenTelemetry. This is mutually
         | 
| 119 | 
            -
                #     exclusive with  | 
| 121 | 
            +
                #     exclusive with `prometheus` and `buffer`.
         | 
| 120 122 | 
             
                # @!attribute prometheus
         | 
| 121 123 | 
             
                #   @return [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually exclusive with
         | 
| 122 | 
            -
                #      | 
| 124 | 
            +
                #     `opentelemetry` and `buffer`.
         | 
| 125 | 
            +
                # @!attribute buffer
         | 
| 126 | 
            +
                #   @return [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with `prometheus`
         | 
| 127 | 
            +
                #     and `opentelemetry`.
         | 
| 123 128 | 
             
                # @!attribute attach_service_name
         | 
| 124 129 | 
             
                #   @return [Boolean] Whether to put the service_name on every metric.
         | 
| 125 130 | 
             
                # @!attribute global_tags
         | 
| @@ -130,19 +135,26 @@ module Temporalio | |
| 130 135 | 
             
                  # Create metrics options. Either `opentelemetry` or `prometheus` required, but not both.
         | 
| 131 136 | 
             
                  #
         | 
| 132 137 | 
             
                  # @param opentelemetry [OpenTelemetryMetricsOptions, nil] OpenTelemetry options if using OpenTelemetry. This is
         | 
| 133 | 
            -
                  #   mutually exclusive with `prometheus`.
         | 
| 138 | 
            +
                  #   mutually exclusive with `prometheus` and `buffer`.
         | 
| 134 139 | 
             
                  # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually
         | 
| 135 | 
            -
                  #   exclusive with `opentelemetry`.
         | 
| 140 | 
            +
                  #   exclusive with `opentelemetry` and `buffer`.
         | 
| 141 | 
            +
                  # @param buffer [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with
         | 
| 142 | 
            +
                  #   `prometheus` and `opentelemetry`.
         | 
| 136 143 | 
             
                  # @param attach_service_name [Boolean] Whether to put the service_name on every metric.
         | 
| 137 144 | 
             
                  # @param global_tags [Hash<String, String>, nil] Resource tags to be applied to all metrics.
         | 
| 138 145 | 
             
                  # @param metric_prefix [String, nil] Prefix to put on every Temporal metric. If unset, defaults to `temporal_`.
         | 
| 139 146 | 
             
                  def initialize(
         | 
| 140 147 | 
             
                    opentelemetry: nil,
         | 
| 141 148 | 
             
                    prometheus: nil,
         | 
| 149 | 
            +
                    buffer: nil,
         | 
| 142 150 | 
             
                    attach_service_name: true,
         | 
| 143 151 | 
             
                    global_tags: nil,
         | 
| 144 152 | 
             
                    metric_prefix: nil
         | 
| 145 153 | 
             
                  )
         | 
| 154 | 
            +
                    if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1
         | 
| 155 | 
            +
                      raise 'Can only have one of opentelemetry, prometheus, or buffer'
         | 
| 156 | 
            +
                    end
         | 
| 157 | 
            +
             | 
| 146 158 | 
             
                    super
         | 
| 147 159 | 
             
                  end
         | 
| 148 160 |  | 
| @@ -152,6 +164,7 @@ module Temporalio | |
| 152 164 | 
             
                    Internal::Bridge::Runtime::MetricsOptions.new(
         | 
| 153 165 | 
             
                      opentelemetry: opentelemetry&._to_bridge,
         | 
| 154 166 | 
             
                      prometheus: prometheus&._to_bridge,
         | 
| 167 | 
            +
                      buffered_with_size: buffer&._buffer_size,
         | 
| 155 168 | 
             
                      attach_service_name:,
         | 
| 156 169 | 
             
                      global_tags:,
         | 
| 157 170 | 
             
                      metric_prefix:
         | 
| @@ -164,7 +177,9 @@ module Temporalio | |
| 164 177 | 
             
                  :headers,
         | 
| 165 178 | 
             
                  :metric_periodicity,
         | 
| 166 179 | 
             
                  :metric_temporality,
         | 
| 167 | 
            -
                  :durations_as_seconds
         | 
| 180 | 
            +
                  :durations_as_seconds,
         | 
| 181 | 
            +
                  :http,
         | 
| 182 | 
            +
                  :histogram_bucket_overrides
         | 
| 168 183 | 
             
                )
         | 
| 169 184 |  | 
| 170 185 | 
             
                # Options for exporting metrics to OpenTelemetry.
         | 
| @@ -181,6 +196,11 @@ module Temporalio | |
| 181 196 | 
             
                # @!attribute durations_as_seconds
         | 
| 182 197 | 
             
                #   @return [Boolean] Whether to use float seconds instead of integer milliseconds for durations, default is
         | 
| 183 198 | 
             
                #     +false+.
         | 
| 199 | 
            +
                # @!attribute http
         | 
| 200 | 
            +
                #   @return [Boolean] True if the protocol is HTTP, false if gRPC (the default).
         | 
| 201 | 
            +
                # @!attribute histogram_bucket_overrides
         | 
| 202 | 
            +
                #   @return [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of the hash it the metric
         | 
| 203 | 
            +
                #     name, value is an array of floats for the set of buckets.
         | 
| 184 204 | 
             
                class OpenTelemetryMetricsOptions
         | 
| 185 205 | 
             
                  # OpenTelemetry metric temporality.
         | 
| 186 206 | 
             
                  module MetricTemporality
         | 
| @@ -196,12 +216,17 @@ module Temporalio | |
| 196 216 | 
             
                  # @param metric_temporality [MetricTemporality] How frequently metrics should be exported.
         | 
| 197 217 | 
             
                  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
         | 
| 198 218 | 
             
                  #   durations.
         | 
| 219 | 
            +
                  # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
         | 
| 220 | 
            +
                  # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
         | 
| 221 | 
            +
                  #   the hash it the metric name, value is an array of floats for the set of buckets.
         | 
| 199 222 | 
             
                  def initialize(
         | 
| 200 223 | 
             
                    url:,
         | 
| 201 224 | 
             
                    headers: nil,
         | 
| 202 225 | 
             
                    metric_periodicity: nil,
         | 
| 203 226 | 
             
                    metric_temporality: MetricTemporality::CUMULATIVE,
         | 
| 204 | 
            -
                    durations_as_seconds: false
         | 
| 227 | 
            +
                    durations_as_seconds: false,
         | 
| 228 | 
            +
                    http: false,
         | 
| 229 | 
            +
                    histogram_bucket_overrides: nil
         | 
| 205 230 | 
             
                  )
         | 
| 206 231 | 
             
                    super
         | 
| 207 232 | 
             
                  end
         | 
| @@ -218,7 +243,9 @@ module Temporalio | |
| 218 243 | 
             
                                                when MetricTemporality::DELTA then true
         | 
| 219 244 | 
             
                                                else raise 'Unrecognized metric temporality'
         | 
| 220 245 | 
             
                                                end,
         | 
| 221 | 
            -
                      durations_as_seconds | 
| 246 | 
            +
                      durations_as_seconds:,
         | 
| 247 | 
            +
                      http:,
         | 
| 248 | 
            +
                      histogram_bucket_overrides:
         | 
| 222 249 | 
             
                    )
         | 
| 223 250 | 
             
                  end
         | 
| 224 251 | 
             
                end
         | 
| @@ -227,7 +254,8 @@ module Temporalio | |
| 227 254 | 
             
                  :bind_address,
         | 
| 228 255 | 
             
                  :counters_total_suffix,
         | 
| 229 256 | 
             
                  :unit_suffix,
         | 
| 230 | 
            -
                  :durations_as_seconds
         | 
| 257 | 
            +
                  :durations_as_seconds,
         | 
| 258 | 
            +
                  :histogram_bucket_overrides
         | 
| 231 259 | 
             
                )
         | 
| 232 260 |  | 
| 233 261 | 
             
                # Options for exporting metrics to Prometheus.
         | 
| @@ -240,6 +268,9 @@ module Temporalio | |
| 240 268 | 
             
                #   @return [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
         | 
| 241 269 | 
             
                # @!attribute durations_as_seconds
         | 
| 242 270 | 
             
                #   @return [Boolean] Whether to use float seconds instead of integer milliseconds for durations.
         | 
| 271 | 
            +
                # @!attribute histogram_bucket_overrides
         | 
| 272 | 
            +
                #   @return [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of the hash it the metric
         | 
| 273 | 
            +
                #     name, value is an array of floats for the set of buckets.
         | 
| 243 274 | 
             
                class PrometheusMetricsOptions
         | 
| 244 275 | 
             
                  # Create Prometheus options.
         | 
| 245 276 | 
             
                  #
         | 
| @@ -248,11 +279,14 @@ module Temporalio | |
| 248 279 | 
             
                  # @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
         | 
| 249 280 | 
             
                  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
         | 
| 250 281 | 
             
                  #   durations.
         | 
| 282 | 
            +
                  # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
         | 
| 283 | 
            +
                  #   the hash it the metric name, value is an array of floats for the set of buckets.
         | 
| 251 284 | 
             
                  def initialize(
         | 
| 252 285 | 
             
                    bind_address:,
         | 
| 253 286 | 
             
                    counters_total_suffix: false,
         | 
| 254 287 | 
             
                    unit_suffix: false,
         | 
| 255 | 
            -
                    durations_as_seconds: false
         | 
| 288 | 
            +
                    durations_as_seconds: false,
         | 
| 289 | 
            +
                    histogram_bucket_overrides: nil
         | 
| 256 290 | 
             
                  )
         | 
| 257 291 | 
             
                    super
         | 
| 258 292 | 
             
                  end
         | 
| @@ -264,7 +298,8 @@ module Temporalio | |
| 264 298 | 
             
                      bind_address:,
         | 
| 265 299 | 
             
                      counters_total_suffix:,
         | 
| 266 300 | 
             
                      unit_suffix:,
         | 
| 267 | 
            -
                      durations_as_seconds | 
| 301 | 
            +
                      durations_as_seconds:,
         | 
| 302 | 
            +
                      histogram_bucket_overrides:
         | 
| 268 303 | 
             
                    )
         | 
| 269 304 | 
             
                  end
         | 
| 270 305 | 
             
                end
         | 
| @@ -295,6 +330,9 @@ module Temporalio | |
| 295 330 | 
             
                #
         | 
| 296 331 | 
             
                # @param telemetry [TelemetryOptions] Telemetry options to set.
         | 
| 297 332 | 
             
                def initialize(telemetry: TelemetryOptions.new)
         | 
| 333 | 
            +
                  # Set runtime on the buffer which will fail if the buffer is used on another runtime
         | 
| 334 | 
            +
                  telemetry.metrics&.buffer&._set_runtime(self)
         | 
| 335 | 
            +
             | 
| 298 336 | 
             
                  @core_runtime = Internal::Bridge::Runtime.new(
         | 
| 299 337 | 
             
                    Internal::Bridge::Runtime::Options.new(telemetry: telemetry._to_bridge)
         | 
| 300 338 | 
             
                  )
         | 
| @@ -251,6 +251,14 @@ module Temporalio | |
| 251 251 | 
             
                  @raw_hash.length
         | 
| 252 252 | 
             
                end
         | 
| 253 253 |  | 
| 254 | 
            +
                # Check equality.
         | 
| 255 | 
            +
                #
         | 
| 256 | 
            +
                # @param other [SearchAttributes] To compare.
         | 
| 257 | 
            +
                # @return [Boolean] Whether equal.
         | 
| 258 | 
            +
                def ==(other)
         | 
| 259 | 
            +
                  other.is_a?(SearchAttributes) && @raw_hash == other._raw_hash
         | 
| 260 | 
            +
                end
         | 
| 261 | 
            +
             | 
| 254 262 | 
             
                alias size length
         | 
| 255 263 |  | 
| 256 264 | 
             
                # Return a new search attributes collection with updates applied.
         | 
| @@ -280,6 +288,11 @@ module Temporalio | |
| 280 288 | 
             
                  end
         | 
| 281 289 | 
             
                end
         | 
| 282 290 |  | 
| 291 | 
            +
                # @!visibility private
         | 
| 292 | 
            +
                def _raw_hash
         | 
| 293 | 
            +
                  @raw_hash
         | 
| 294 | 
            +
                end
         | 
| 295 | 
            +
             | 
| 283 296 | 
             
                # @!visibility private
         | 
| 284 297 | 
             
                def _to_proto
         | 
| 285 298 | 
             
                  Api::Common::V1::SearchAttributes.new(indexed_fields: _to_proto_hash)
         | 
| @@ -13,8 +13,8 @@ module Temporalio | |
| 13 13 | 
             
                # cancellation can be set, users create this for each activity that is run. There is no real performance penalty for
         | 
| 14 14 | 
             
                # creating an environment for every run.
         | 
| 15 15 | 
             
                class ActivityEnvironment
         | 
| 16 | 
            -
                  # @return [Activity::Info] The activity info used by default. This is frozen, but can be  | 
| 17 | 
            -
                  #   in to {initialize}.
         | 
| 16 | 
            +
                  # @return [Activity::Info] The activity info used by default. This is frozen, but `with` can be used to make a new
         | 
| 17 | 
            +
                  #   instance with changes to pass in to {initialize}.
         | 
| 18 18 | 
             
                  def self.default_info
         | 
| 19 19 | 
             
                    @default_info ||= Activity::Info.new(
         | 
| 20 20 | 
             
                      activity_id: 'test',
         | 
| @@ -34,12 +34,13 @@ module Temporalio | |
| 34 34 | 
             
                      workflow_namespace: 'default',
         | 
| 35 35 | 
             
                      workflow_run_id: 'test-run',
         | 
| 36 36 | 
             
                      workflow_type: 'test'
         | 
| 37 | 
            -
                    ) | 
| 37 | 
            +
                    )
         | 
| 38 38 | 
             
                  end
         | 
| 39 39 |  | 
| 40 40 | 
             
                  # Create a test environment for activities.
         | 
| 41 41 | 
             
                  #
         | 
| 42 | 
            -
                  # @param info [Activity::Info] Value for {Activity::Context#info}.
         | 
| 42 | 
            +
                  # @param info [Activity::Info] Value for {Activity::Context#info}. Users should not try to instantiate this
         | 
| 43 | 
            +
                  #   themselves, but rather use `with` on {default_info}.
         | 
| 43 44 | 
             
                  # @param on_heartbeat [Proc(Array), nil] Proc that is called with all heartbeat details when
         | 
| 44 45 | 
             
                  #   {Activity::Context#heartbeat} is called.
         | 
| 45 46 | 
             
                  # @param cancellation [Cancellation] Value for {Activity::Context#cancellation}.
         | 
| @@ -47,6 +48,9 @@ module Temporalio | |
| 47 48 | 
             
                  # @param payload_converter [Converters::PayloadConverter] Value for {Activity::Context#payload_converter}.
         | 
| 48 49 | 
             
                  # @param logger [Logger] Value for {Activity::Context#logger}.
         | 
| 49 50 | 
             
                  # @param activity_executors [Hash<Symbol, Worker::ActivityExecutor>] Executors that activities can run within.
         | 
| 51 | 
            +
                  # @param metric_meter [Metric::Meter, nil] Value for {Activity::Context#metric_meter}, or nil to raise when
         | 
| 52 | 
            +
                  #   called.
         | 
| 53 | 
            +
                  # @param client [Client, nil] Value for {Activity::Context#client}, or nil to raise when called.
         | 
| 50 54 | 
             
                  def initialize(
         | 
| 51 55 | 
             
                    info: ActivityEnvironment.default_info,
         | 
| 52 56 | 
             
                    on_heartbeat: nil,
         | 
| @@ -54,7 +58,9 @@ module Temporalio | |
| 54 58 | 
             
                    worker_shutdown_cancellation: Cancellation.new,
         | 
| 55 59 | 
             
                    payload_converter: Converters::PayloadConverter.default,
         | 
| 56 60 | 
             
                    logger: Logger.new(nil),
         | 
| 57 | 
            -
                    activity_executors: Worker::ActivityExecutor.defaults
         | 
| 61 | 
            +
                    activity_executors: Worker::ActivityExecutor.defaults,
         | 
| 62 | 
            +
                    metric_meter: nil,
         | 
| 63 | 
            +
                    client: nil
         | 
| 58 64 | 
             
                  )
         | 
| 59 65 | 
             
                    @info = info
         | 
| 60 66 | 
             
                    @on_heartbeat = on_heartbeat
         | 
| @@ -63,6 +69,8 @@ module Temporalio | |
| 63 69 | 
             
                    @payload_converter = payload_converter
         | 
| 64 70 | 
             
                    @logger = logger
         | 
| 65 71 | 
             
                    @activity_executors = activity_executors
         | 
| 72 | 
            +
                    @metric_meter = metric_meter
         | 
| 73 | 
            +
                    @client = client
         | 
| 66 74 | 
             
                  end
         | 
| 67 75 |  | 
| 68 76 | 
             
                  # Run an activity and returns its result or raises its exception.
         | 
| @@ -86,10 +94,12 @@ module Temporalio | |
| 86 94 | 
             
                                                            cancellation: @cancellation,
         | 
| 87 95 | 
             
                                                            worker_shutdown_cancellation: @worker_shutdown_cancellation,
         | 
| 88 96 | 
             
                                                            payload_converter: @payload_converter,
         | 
| 89 | 
            -
                                                            logger: @logger
         | 
| 97 | 
            +
                                                            logger: @logger,
         | 
| 98 | 
            +
                                                            metric_meter: @metric_meter,
         | 
| 99 | 
            +
                                                            client: @client
         | 
| 90 100 | 
             
                                                          ))
         | 
| 91 101 | 
             
                      queue.push([defn.proc.call(*args), nil])
         | 
| 92 | 
            -
                    rescue Exception => e # rubocop:disable Lint/RescueException Intentionally capturing all exceptions
         | 
| 102 | 
            +
                    rescue Exception => e # rubocop:disable Lint/RescueException -- Intentionally capturing all exceptions
         | 
| 93 103 | 
             
                      queue.push([nil, e])
         | 
| 94 104 | 
             
                    ensure
         | 
| 95 105 | 
             
                      executor.set_activity_context(defn, nil)
         | 
| @@ -113,7 +123,9 @@ module Temporalio | |
| 113 123 | 
             
                      cancellation:,
         | 
| 114 124 | 
             
                      worker_shutdown_cancellation:,
         | 
| 115 125 | 
             
                      payload_converter:,
         | 
| 116 | 
            -
                      logger | 
| 126 | 
            +
                      logger:,
         | 
| 127 | 
            +
                      metric_meter:,
         | 
| 128 | 
            +
                      client:
         | 
| 117 129 | 
             
                    )
         | 
| 118 130 | 
             
                      @info = info
         | 
| 119 131 | 
             
                      @instance = instance
         | 
| @@ -122,12 +134,24 @@ module Temporalio | |
| 122 134 | 
             
                      @worker_shutdown_cancellation = worker_shutdown_cancellation
         | 
| 123 135 | 
             
                      @payload_converter = payload_converter
         | 
| 124 136 | 
             
                      @logger = logger
         | 
| 137 | 
            +
                      @metric_meter = metric_meter
         | 
| 138 | 
            +
                      @client = client
         | 
| 125 139 | 
             
                    end
         | 
| 126 140 |  | 
| 127 141 | 
             
                    # @!visibility private
         | 
| 128 142 | 
             
                    def heartbeat(*details)
         | 
| 129 143 | 
             
                      @on_heartbeat&.call(details)
         | 
| 130 144 | 
             
                    end
         | 
| 145 | 
            +
             | 
| 146 | 
            +
                    # @!visibility private
         | 
| 147 | 
            +
                    def metric_meter
         | 
| 148 | 
            +
                      @metric_meter or raise 'No metric meter configured in this test environment'
         | 
| 149 | 
            +
                    end
         | 
| 150 | 
            +
             | 
| 151 | 
            +
                    # @!visibility private
         | 
| 152 | 
            +
                    def client
         | 
| 153 | 
            +
                      @client or raise 'No client configured in this test environment'
         | 
| 154 | 
            +
                    end
         | 
| 131 155 | 
             
                  end
         | 
| 132 156 |  | 
| 133 157 | 
             
                  private_constant :Context
         | 
| @@ -10,6 +10,7 @@ require 'temporalio/converters' | |
| 10 10 | 
             
            require 'temporalio/internal/bridge/testing'
         | 
| 11 11 | 
             
            require 'temporalio/internal/proto_utils'
         | 
| 12 12 | 
             
            require 'temporalio/runtime'
         | 
| 13 | 
            +
            require 'temporalio/search_attributes'
         | 
| 13 14 | 
             
            require 'temporalio/version'
         | 
| 14 15 |  | 
| 15 16 | 
             
            module Temporalio
         | 
| @@ -34,8 +35,10 @@ module Temporalio | |
| 34 35 | 
             
                  # @param default_workflow_query_reject_condition [WorkflowQueryRejectCondition, nil] Default rejection condition
         | 
| 35 36 | 
             
                  #   for the client.
         | 
| 36 37 | 
             
                  # @param ip [String] IP to bind to.
         | 
| 37 | 
            -
                  # @param port [Integer, nil] Port to bind on, or  | 
| 38 | 
            +
                  # @param port [Integer, nil] Port to bind on, or `nil` for random.
         | 
| 38 39 | 
             
                  # @param ui [Boolean] If +true+, also starts the UI.
         | 
| 40 | 
            +
                  # @param ui_port [Integer, nil] Port to bind on if `ui` is true, or `nil` for random.
         | 
| 41 | 
            +
                  # @param search_attributes [Array<SearchAttributes::Key>] Search attributes to make available on start.
         | 
| 39 42 | 
             
                  # @param runtime [Runtime] Runtime for the server and client.
         | 
| 40 43 | 
             
                  # @param dev_server_existing_path [String, nil] Existing CLI path to use instead of downloading and caching to
         | 
| 41 44 | 
             
                  #   tmp.
         | 
| @@ -46,6 +49,8 @@ module Temporalio | |
| 46 49 | 
             
                  # @param dev_server_download_version [String] Version of dev server to download and cache.
         | 
| 47 50 | 
             
                  # @param dev_server_download_dest_dir [String, nil] Where to download. Defaults to tmp.
         | 
| 48 51 | 
             
                  # @param dev_server_extra_args [Array<String>] Any extra arguments for the CLI dev server.
         | 
| 52 | 
            +
                  # @param dev_server_download_ttl [Float, nil] How long the automatic download should be cached for. If nil, cached
         | 
| 53 | 
            +
                  #   indefinitely.
         | 
| 49 54 | 
             
                  #
         | 
| 50 55 | 
             
                  # @yield [environment] If a block is given, it is called with the environment and upon complete the environment is
         | 
| 51 56 | 
             
                  #   shutdown.
         | 
| @@ -62,6 +67,8 @@ module Temporalio | |
| 62 67 | 
             
                    ip: '127.0.0.1',
         | 
| 63 68 | 
             
                    port: nil,
         | 
| 64 69 | 
             
                    ui: false, # rubocop:disable Naming/MethodParameterName
         | 
| 70 | 
            +
                    ui_port: nil,
         | 
| 71 | 
            +
                    search_attributes: [],
         | 
| 65 72 | 
             
                    runtime: Runtime.default,
         | 
| 66 73 | 
             
                    dev_server_existing_path: nil,
         | 
| 67 74 | 
             
                    dev_server_database_filename: nil,
         | 
| @@ -70,8 +77,18 @@ module Temporalio | |
| 70 77 | 
             
                    dev_server_download_version: 'default',
         | 
| 71 78 | 
             
                    dev_server_download_dest_dir: nil,
         | 
| 72 79 | 
             
                    dev_server_extra_args: [],
         | 
| 80 | 
            +
                    dev_server_download_ttl: nil,
         | 
| 73 81 | 
             
                    &
         | 
| 74 82 | 
             
                  )
         | 
| 83 | 
            +
                    # Add search attribute args
         | 
| 84 | 
            +
                    unless search_attributes.empty?
         | 
| 85 | 
            +
                      dev_server_extra_args += search_attributes.flat_map do |key|
         | 
| 86 | 
            +
                        raise 'Search attribute must be Key' unless key.is_a?(SearchAttributes::Key)
         | 
| 87 | 
            +
             | 
| 88 | 
            +
                        ['--search-attribute', "#{key.name}=#{SearchAttributes::IndexedValueType::PROTO_NAMES[key.type]}"]
         | 
| 89 | 
            +
                      end
         | 
| 90 | 
            +
                    end
         | 
| 91 | 
            +
             | 
| 75 92 | 
             
                    server_options = Internal::Bridge::Testing::EphemeralServer::StartDevServerOptions.new(
         | 
| 76 93 | 
             
                      existing_path: dev_server_existing_path,
         | 
| 77 94 | 
             
                      sdk_name: 'sdk-ruby',
         | 
| @@ -83,9 +100,11 @@ module Temporalio | |
| 83 100 | 
             
                      port:,
         | 
| 84 101 | 
             
                      database_filename: dev_server_database_filename,
         | 
| 85 102 | 
             
                      ui:,
         | 
| 103 | 
            +
                      ui_port: ui ? ui_port : nil,
         | 
| 86 104 | 
             
                      log_format: dev_server_log_format,
         | 
| 87 105 | 
             
                      log_level: dev_server_log_level,
         | 
| 88 | 
            -
                      extra_args: dev_server_extra_args
         | 
| 106 | 
            +
                      extra_args: dev_server_extra_args,
         | 
| 107 | 
            +
                      download_ttl: dev_server_download_ttl
         | 
| 89 108 | 
             
                    )
         | 
| 90 109 | 
             
                    _with_core_server(
         | 
| 91 110 | 
             
                      core_server: Internal::Bridge::Testing::EphemeralServer.start_dev_server(
         | 
| @@ -122,6 +141,8 @@ module Temporalio | |
| 122 141 | 
             
                  # @param test_server_download_version [String] Version of test server to download and cache.
         | 
| 123 142 | 
             
                  # @param test_server_download_dest_dir [String, nil] Where to download. Defaults to tmp.
         | 
| 124 143 | 
             
                  # @param test_server_extra_args [Array<String>] Any extra arguments for the test server.
         | 
| 144 | 
            +
                  # @param test_server_download_ttl [Float, nil] How long the automatic download should be cached for. If nil,
         | 
| 145 | 
            +
                  #   cached indefinitely.
         | 
| 125 146 | 
             
                  #
         | 
| 126 147 | 
             
                  # @yield [environment] If a block is given, it is called with the environment and upon complete the environment is
         | 
| 127 148 | 
             
                  #   shutdown.
         | 
| @@ -140,6 +161,7 @@ module Temporalio | |
| 140 161 | 
             
                    test_server_download_version: 'default',
         | 
| 141 162 | 
             
                    test_server_download_dest_dir: nil,
         | 
| 142 163 | 
             
                    test_server_extra_args: [],
         | 
| 164 | 
            +
                    test_server_download_ttl: nil,
         | 
| 143 165 | 
             
                    &
         | 
| 144 166 | 
             
                  )
         | 
| 145 167 | 
             
                    server_options = Internal::Bridge::Testing::EphemeralServer::StartTestServerOptions.new(
         | 
| @@ -149,7 +171,8 @@ module Temporalio | |
| 149 171 | 
             
                      download_version: test_server_download_version,
         | 
| 150 172 | 
             
                      download_dest_dir: test_server_download_dest_dir,
         | 
| 151 173 | 
             
                      port:,
         | 
| 152 | 
            -
                      extra_args: test_server_extra_args
         | 
| 174 | 
            +
                      extra_args: test_server_extra_args,
         | 
| 175 | 
            +
                      download_ttl: test_server_download_ttl
         | 
| 153 176 | 
             
                    )
         | 
| 154 177 | 
             
                    _with_core_server(
         | 
| 155 178 | 
             
                      core_server: Internal::Bridge::Testing::EphemeralServer.start_test_server(
         | 
    
        data/lib/temporalio/version.rb
    CHANGED
    
    
| @@ -206,6 +206,7 @@ module Temporalio | |
| 206 206 | 
             
                      :activity,
         | 
| 207 207 | 
             
                      :args,
         | 
| 208 208 | 
             
                      :task_queue,
         | 
| 209 | 
            +
                      :summary,
         | 
| 209 210 | 
             
                      :schedule_to_close_timeout,
         | 
| 210 211 | 
             
                      :schedule_to_start_timeout,
         | 
| 211 212 | 
             
                      :start_to_close_timeout,
         | 
| @@ -270,6 +271,8 @@ module Temporalio | |
| 270 271 | 
             
                      :args,
         | 
| 271 272 | 
             
                      :id,
         | 
| 272 273 | 
             
                      :task_queue,
         | 
| 274 | 
            +
                      :static_summary,
         | 
| 275 | 
            +
                      :static_details,
         | 
| 273 276 | 
             
                      :cancellation,
         | 
| 274 277 | 
             
                      :cancellation_type,
         | 
| 275 278 | 
             
                      :parent_close_policy,
         | 
| @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
            # Much of this logic taken from
         | 
| 4 | 
            -
            # https://github.com/ruby-concurrency/concurrent-ruby/blob/044020f44b36930b863b930f3ee8fa1e9f750469/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb,
         | 
| 5 | 
            -
            # see MIT license at
         | 
| 6 | 
            -
            # https://github.com/ruby-concurrency/concurrent-ruby/blob/044020f44b36930b863b930f3ee8fa1e9f750469/LICENSE.txt
         | 
| 7 | 
            -
             | 
| 8 3 | 
             
            module Temporalio
         | 
| 9 4 | 
             
              class Worker
         | 
| 10 5 | 
             
                # Implementation of a thread pool. This implementation is a stripped down form of Concurrent Ruby's
         | 
| 11 6 | 
             
                # `CachedThreadPool`.
         | 
| 12 7 | 
             
                class ThreadPool
         | 
| 8 | 
            +
                  # Much of this logic taken from
         | 
| 9 | 
            +
                  # https://github.com/ruby-concurrency/concurrent-ruby/blob/044020f44b36930b863b930f3ee8fa1e9f750469/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb,
         | 
| 10 | 
            +
                  # see MIT license at
         | 
| 11 | 
            +
                  # https://github.com/ruby-concurrency/concurrent-ruby/blob/044020f44b36930b863b930f3ee8fa1e9f750469/LICENSE.txt
         | 
| 12 | 
            +
             | 
| 13 13 | 
             
                  # @return [ThreadPool] Default/shared thread pool instance with unlimited max threads.
         | 
| 14 14 | 
             
                  def self.default
         | 
| 15 15 | 
             
                    @default ||= new
         | 
| @@ -186,8 +186,12 @@ module Temporalio | |
| 186 186 | 
             
                        raise 'Missing initialize job in initial activation' unless init_job
         | 
| 187 187 |  | 
| 188 188 | 
             
                        # Obtain definition
         | 
| 189 | 
            -
                        definition = worker_state.workflow_definitions[init_job.workflow_type] | 
| 190 | 
            -
             | 
| 189 | 
            +
                        definition = worker_state.workflow_definitions[init_job.workflow_type]
         | 
| 190 | 
            +
                        # If not present and not reserved, try dynamic
         | 
| 191 | 
            +
                        if !definition && !Internal::ProtoUtils.reserved_name?(init_job.workflow_type)
         | 
| 192 | 
            +
                          definition = worker_state.workflow_definitions[nil]
         | 
| 193 | 
            +
                        end
         | 
| 194 | 
            +
             | 
| 191 195 | 
             
                        unless definition
         | 
| 192 196 | 
             
                          raise Error::ApplicationError.new(
         | 
| 193 197 | 
             
                            "Workflow type #{init_job.workflow_type} is not registered on this worker, available workflows: " +
         | 
| @@ -209,7 +213,8 @@ module Temporalio | |
| 209 213 | 
             
                            interceptors: worker_state.workflow_interceptors,
         | 
| 210 214 | 
             
                            disable_eager_activity_execution: worker_state.disable_eager_activity_execution,
         | 
| 211 215 | 
             
                            illegal_calls: worker_state.illegal_calls,
         | 
| 212 | 
            -
                            workflow_failure_exception_types: worker_state.workflow_failure_exception_types
         | 
| 216 | 
            +
                            workflow_failure_exception_types: worker_state.workflow_failure_exception_types,
         | 
| 217 | 
            +
                            unsafe_workflow_io_enabled: worker_state.unsafe_workflow_io_enabled
         | 
| 213 218 | 
             
                          )
         | 
| 214 219 | 
             
                        )
         | 
| 215 220 | 
             
                      end
         | 
| @@ -30,6 +30,7 @@ module Temporalio | |
| 30 30 | 
             
                    :illegal_workflow_calls,
         | 
| 31 31 | 
             
                    :workflow_failure_exception_types,
         | 
| 32 32 | 
             
                    :workflow_payload_codec_thread_pool,
         | 
| 33 | 
            +
                    :unsafe_workflow_io_enabled,
         | 
| 33 34 | 
             
                    :debug_mode,
         | 
| 34 35 | 
             
                    :runtime
         | 
| 35 36 | 
             
                  )
         | 
| @@ -69,6 +70,9 @@ module Temporalio | |
| 69 70 | 
             
                  # @param workflow_payload_codec_thread_pool [ThreadPool, nil] Thread pool to run payload codec encode/decode
         | 
| 70 71 | 
             
                  #   within. This is required if a payload codec exists and the worker is not fiber based. Codecs can potentially
         | 
| 71 72 | 
             
                  #   block execution which is why they need to be run in the background.
         | 
| 73 | 
            +
                  # @param unsafe_workflow_io_enabled [Boolean] If false, the default, workflow code that invokes io_wait on the
         | 
| 74 | 
            +
                  #   fiber scheduler will fail. Instead of setting this to true, users are encouraged to use
         | 
| 75 | 
            +
                  #   {Workflow::Unsafe.io_enabled} with a block for narrower enabling of IO.
         | 
| 72 76 | 
             
                  # @param debug_mode [Boolean] If true, deadlock detection is disabled. Deadlock detection will fail workflow tasks
         | 
| 73 77 | 
             
                  #   if they block the thread for too long. This defaults to true if the `TEMPORAL_DEBUG` environment variable is
         | 
| 74 78 | 
             
                  #   `true` or `1`.
         | 
| @@ -89,6 +93,7 @@ module Temporalio | |
| 89 93 | 
             
                    illegal_workflow_calls: Worker.default_illegal_workflow_calls,
         | 
| 90 94 | 
             
                    workflow_failure_exception_types: [],
         | 
| 91 95 | 
             
                    workflow_payload_codec_thread_pool: nil,
         | 
| 96 | 
            +
                    unsafe_workflow_io_enabled: false,
         | 
| 92 97 | 
             
                    debug_mode: %w[true 1].include?(ENV['TEMPORAL_DEBUG'].to_s.downcase),
         | 
| 93 98 | 
             
                    runtime: Runtime.default,
         | 
| 94 99 | 
             
                    &
         | 
| @@ -106,6 +111,7 @@ module Temporalio | |
| 106 111 | 
             
                      illegal_workflow_calls:,
         | 
| 107 112 | 
             
                      workflow_failure_exception_types:,
         | 
| 108 113 | 
             
                      workflow_payload_codec_thread_pool:,
         | 
| 114 | 
            +
                      unsafe_workflow_io_enabled:,
         | 
| 109 115 | 
             
                      debug_mode:,
         | 
| 110 116 | 
             
                      runtime:
         | 
| 111 117 | 
             
                    ).freeze
         | 
| @@ -237,6 +243,7 @@ module Temporalio | |
| 237 243 | 
             
                        illegal_workflow_calls: options.illegal_workflow_calls,
         | 
| 238 244 | 
             
                        workflow_failure_exception_types: options.workflow_failure_exception_types,
         | 
| 239 245 | 
             
                        workflow_payload_codec_thread_pool: options.workflow_payload_codec_thread_pool,
         | 
| 246 | 
            +
                        unsafe_workflow_io_enabled: options.unsafe_workflow_io_enabled,
         | 
| 240 247 | 
             
                        debug_mode: options.debug_mode,
         | 
| 241 248 | 
             
                        on_eviction: proc { |_, remove_job| @last_workflow_remove_job = remove_job } # steep:ignore
         | 
| 242 249 | 
             
                      )
         |