temporalio 1.4.0 → 1.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d8a5c63465067a03ec252a3550f4048d63f93bde9dda135e1495b4d3e6dc8db
4
- data.tar.gz: 71721d0517ac5db6ef9b6be9c2f102a95268b29d1979caec619ade7b96e01671
3
+ metadata.gz: f9ab77e9e3a462220ab99a1eb7814e4e7e6c7f9485487344cda2e12b8f983147
4
+ data.tar.gz: d3d2f0a9026ec2033de2a367735d9ddffec50ced84c5bd99f049f481ea534b89
5
5
  SHA512:
6
- metadata.gz: 74dbf0015f65ef25c709873993ea75a7eebe963a29baf27cea261056d2e4f2b666a6bace656d257e60557f2d8cbc3f1674f4cb4f690f458522ce4a070d47986f
7
- data.tar.gz: 1879fe1df4a34f98b6c12602387d18a02bdf174dfec6995fbef901999d74fd71263837aa8079c69bf2d87580eb15c7c3bd7c0a948a1aaeda704b4355f3b93147
6
+ metadata.gz: 436ef0cdcbf32fe0c88c719a409dc1707e141df0e8bccb5f024c181f5c41ab7f03a2ccf83e445cf9c1b98e208ef618ad8dcf2715ce767d46b99e903e766eb9c5
7
+ data.tar.gz: 780131e186208f905023064c38d6298d94f4218909e34ff381261167ea38e7d13754a157a33ff0db2b8de79551827d3dd449dabcd0db66bbfdfc16bcb5c8cd38
data/README.md CHANGED
@@ -86,7 +86,7 @@ Also see:
86
86
 
87
87
  ### Installation
88
88
 
89
- The Ruby SDK works with Ruby 3.3, 3.4, and 4.0.
89
+ The Ruby SDK works with Ruby 3.3, 3.4, and 4.0. (If using Fibers, Ruby 3.3.2+ is recommended due to problems with fibers in previous versions.)
90
90
 
91
91
  Can require in a Gemfile like:
92
92
 
@@ -1265,7 +1265,7 @@ work with Ractors.
1265
1265
  ### Platform Support
1266
1266
 
1267
1267
  This SDK is backed by a Ruby C extension written in Rust leveraging the
1268
- [Temporal Rust Core](https://github.com/temporalio/sdk-core). Gems are currently published for the following platforms:
1268
+ [Temporal Rust Core](https://github.com/temporalio/sdk-rust). Gems are currently published for the following platforms:
1269
1269
 
1270
1270
  * `aarch64-linux`
1271
1271
  * `aarch64-linux-musl`
@@ -24,7 +24,8 @@ module Temporalio
24
24
  :keep_alive,
25
25
  :http_connect_proxy,
26
26
  :runtime,
27
- :lazy_connect
27
+ :lazy_connect,
28
+ :dns_load_balancing
28
29
  )
29
30
 
30
31
  # Options as returned from {options} for +**to_h+ splat use in {initialize}. See {initialize} for details.
@@ -132,6 +133,22 @@ module Temporalio
132
133
  # @return [String, nil] Pass for HTTP basic auth for the proxy, must be combined with {basic_auth_user}.
133
134
  class HTTPConnectProxyOptions; end # rubocop:disable Lint/EmptyClass
134
135
 
136
+ DnsLoadBalancingOptions = Data.define(
137
+ :resolution_interval
138
+ )
139
+
140
+ # DNS load balancing options for client connections. When set, Core periodically re-resolves the target host's
141
+ # DNS records and round-robins requests across the resolved addresses. Mutually exclusive with
142
+ # {HTTPConnectProxyOptions} -- DNS load balancing is silently disabled when an HTTP CONNECT proxy is configured.
143
+ #
144
+ # @!attribute resolution_interval
145
+ # @return [Float] How often to re-resolve DNS, in seconds. Default 30.0.
146
+ class DnsLoadBalancingOptions
147
+ def initialize(resolution_interval: 30.0)
148
+ super
149
+ end
150
+ end
151
+
135
152
  # @return [Options] Frozen options for this client which has the same attributes as {initialize}. Note that if
136
153
  # {api_key=} or {rpc_metadata=} are updated, the options object is replaced with those changes (it is not
137
154
  # mutated in place).
@@ -169,6 +186,8 @@ module Temporalio
169
186
  # @param lazy_connect [Boolean] If true, there is no connection until the first call is attempted or a worker
170
187
  # is created with it. Clients from lazy connections cannot be used for workers if they have not performed a
171
188
  # connection.
189
+ # @param dns_load_balancing [DnsLoadBalancingOptions, nil] DNS load balancing options for this connection. Default
190
+ # is +nil+ (disabled). Silently disabled when +http_connect_proxy+ is set, since the two are mutually exclusive.
172
191
  # @param around_connect [Proc, nil] If present, this proc accepts two values: options and a block. The block must
173
192
  # be yielded to only once with the options. The block does not return a meaningful value, nor should
174
193
  # around_connect.
@@ -185,6 +204,7 @@ module Temporalio
185
204
  http_connect_proxy: nil,
186
205
  runtime: Runtime.default,
187
206
  lazy_connect: false,
207
+ dns_load_balancing: nil,
188
208
  around_connect: nil
189
209
  )
190
210
  @options = Options.new(
@@ -197,7 +217,8 @@ module Temporalio
197
217
  keep_alive:,
198
218
  http_connect_proxy:,
199
219
  runtime:,
200
- lazy_connect:
220
+ lazy_connect:,
221
+ dns_load_balancing:
201
222
  ).freeze
202
223
  @core_client_mutex = Mutex.new
203
224
  # Create core client now if not lazy, applying around_connect if present
@@ -329,6 +350,11 @@ module Temporalio
329
350
  basic_auth_pass: @options.http_connect_proxy.basic_auth_pass
330
351
  )
331
352
  end
353
+ if (dns_load_balancing = @options.dns_load_balancing)
354
+ options.dns_load_balancing = Internal::Bridge::Client::DnsLoadBalancingOptions.new(
355
+ resolution_interval: dns_load_balancing.resolution_interval
356
+ )
357
+ end
332
358
  Internal::Bridge::Client.new(@options.runtime._core_runtime, options)
333
359
  end
334
360
  end
@@ -3,6 +3,7 @@
3
3
  require 'temporalio/api'
4
4
  require 'temporalio/converters'
5
5
  require 'temporalio/internal/proto_utils'
6
+ require 'temporalio/priority'
6
7
  require 'temporalio/retry_policy'
7
8
  require 'temporalio/search_attributes'
8
9
 
@@ -175,6 +176,7 @@ module Temporalio
175
176
  :retry_policy,
176
177
  :memo,
177
178
  :search_attributes,
179
+ :priority,
178
180
  :arg_hints,
179
181
  :headers
180
182
  )
@@ -209,6 +211,8 @@ module Temporalio
209
211
  # @return [Hash<String, Object>, nil] Memo for the workflow.
210
212
  # @!attribute search_attributes
211
213
  # @return [SearchAttributes, nil] Search attributes for the workflow.
214
+ # @!attribute priority
215
+ # @return [Priority] Priority of the workflow. This is currently experimental.
212
216
  # @!attribute arg_hints
213
217
  # @return [Array<Object>, nil] Converter hints for workflow arguments. This is only user-set (e.g. on create)
214
218
  # and is not persisted and therefore will not be set when describing a workflow.
@@ -239,6 +243,7 @@ module Temporalio
239
243
  # @param retry_policy [RetryPolicy, nil] Retry policy for the workflow.
240
244
  # @param memo [Hash<String, Object>, nil] Memo for the workflow.
241
245
  # @param search_attributes [SearchAttributes, nil] Search attributes for the workflow.
246
+ # @param priority [Priority] Priority of the workflow. This is currently experimental.
242
247
  # @param headers [Hash<String, Object>, nil] Headers for the workflow.
243
248
  def new(
244
249
  workflow,
@@ -253,6 +258,7 @@ module Temporalio
253
258
  retry_policy: nil,
254
259
  memo: nil,
255
260
  search_attributes: nil,
261
+ priority: Priority.default,
256
262
  arg_hints: nil,
257
263
  headers: nil
258
264
  )
@@ -271,6 +277,7 @@ module Temporalio
271
277
  retry_policy:,
272
278
  memo:,
273
279
  search_attributes:,
280
+ priority:,
274
281
  arg_hints: arg_hints || defn_arg_hints,
275
282
  headers:
276
283
  )
@@ -293,6 +300,7 @@ module Temporalio
293
300
  retry_policy: raw_info.retry_policy ? RetryPolicy._from_proto(raw_info.retry_policy) : nil,
294
301
  memo: Internal::ProtoUtils.memo_from_proto(raw_info.memo, data_converter),
295
302
  search_attributes: SearchAttributes._from_proto(raw_info.search_attributes),
303
+ priority: Priority._from_proto(raw_info.priority),
296
304
  headers: Internal::ProtoUtils.headers_from_proto(raw_info.header, data_converter)
297
305
  )
298
306
  end
@@ -312,6 +320,7 @@ module Temporalio
312
320
  memo: Internal::ProtoUtils.memo_to_proto(memo, data_converter),
313
321
  search_attributes: search_attributes&._to_proto,
314
322
  header: Internal::ProtoUtils.headers_to_proto(headers, data_converter),
323
+ priority: priority._to_proto,
315
324
  user_metadata: Internal::ProtoUtils.to_user_metadata(static_summary, static_details, data_converter)
316
325
  )
317
326
  )
@@ -95,6 +95,9 @@ module Temporalio
95
95
  # @param runtime [Runtime] Runtime for this client.
96
96
  # @param lazy_connect [Boolean] If true, the client will not connect until the first call is attempted or a worker
97
97
  # is created with it. Lazy clients cannot be used for workers if they have not performed a connection.
98
+ # @param dns_load_balancing [Connection::DnsLoadBalancingOptions, nil] DNS load balancing options for the
99
+ # connection. Default is +nil+ (disabled). Silently disabled when +http_connect_proxy+ is set, since the two are
100
+ # mutually exclusive.
98
101
  #
99
102
  # @return [Client] Connected client.
100
103
  #
@@ -116,7 +119,8 @@ module Temporalio
116
119
  keep_alive: Connection::KeepAliveOptions.new, # Set to nil to disable
117
120
  http_connect_proxy: nil,
118
121
  runtime: Runtime.default,
119
- lazy_connect: false
122
+ lazy_connect: false,
123
+ dns_load_balancing: nil
120
124
  )
121
125
  # Prepare connection. The connection var is needed here so it can be used in callback for plugin.
122
126
  base_connection = nil
@@ -162,6 +166,7 @@ module Temporalio
162
166
  http_connect_proxy:,
163
167
  runtime:,
164
168
  lazy_connect:,
169
+ dns_load_balancing:,
165
170
  around_connect: # steep:ignore
166
171
  )
167
172
 
@@ -50,6 +50,22 @@ module Temporalio
50
50
  # workflow code.
51
51
  AUTO_UPGRADE =
52
52
  Api::Enums::V1::ContinueAsNewVersioningBehavior::CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_AUTO_UPGRADE
53
+ # Use the Ramping Version of the workflow's task queue at start time, regardless of the workflow's
54
+ # Target Version (according to f(workflow_id, ramp_percentage)). After the first workflow task completes,
55
+ # the workflow will use whatever Versioning Behavior it is annotated with. If there is no Ramping
56
+ # Version by the time that the first workflow task is dispatched, it will be sent to the Current Version.
57
+ #
58
+ # It is highly discouraged to use this if the workflow is annotated with AutoUpgrade behavior, because
59
+ # this setting ONLY applies to the first task of the workflow. If, after the first task, the workflow
60
+ # is AutoUpgrade, it will behave like a normal AutoUpgrade workflow and go to the Target Version, which
61
+ # may be the Current Version instead of the Ramping Version.
62
+ #
63
+ # Note that if the workflow being continued has a Pinned override, that override will be inherited by the
64
+ # new workflow run regardless of the ContinueAsNewVersioningBehavior specified in the continue-as-new
65
+ # command. Versioning Override always takes precedence until it's removed manually via
66
+ # UpdateWorkflowExecutionOptions.
67
+ USE_RAMPING_VERSION =
68
+ Api::Enums::V1::ContinueAsNewVersioningBehavior::CONTINUE_AS_NEW_VERSIONING_BEHAVIOR_USE_RAMPING_VERSION
53
69
  end
54
70
 
55
71
  # Specifies why the server suggests continue-as-new. This is currently experimental.
@@ -16,7 +16,8 @@ module Temporalio
16
16
  :tls, # Optional
17
17
  :rpc_retry,
18
18
  :keep_alive, # Optional
19
- :http_connect_proxy # Optional
19
+ :http_connect_proxy, # Optional
20
+ :dns_load_balancing # Optional
20
21
  )
21
22
 
22
23
  TLSOptions = Struct.new(
@@ -46,6 +47,10 @@ module Temporalio
46
47
  :basic_auth_pass # Optional
47
48
  )
48
49
 
50
+ DnsLoadBalancingOptions = Struct.new(
51
+ :resolution_interval
52
+ )
53
+
49
54
  def self.new(runtime, options)
50
55
  queue = Queue.new
51
56
  async_new(runtime, options, queue)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Temporalio
4
- VERSION = '1.4.0'
4
+ VERSION = '1.4.1'
5
5
  end
@@ -672,7 +672,8 @@ module Temporalio
672
672
  # current workflow.
673
673
  # @param initial_versioning_behavior [ContinueAsNewVersioningBehavior::enum, nil] Versioning behavior for the
674
674
  # first task of the new run. Set to {ContinueAsNewVersioningBehavior::AUTO_UPGRADE} to upgrade a pinned workflow
675
- # to the latest version on continue-as-new. This is currently experimental.
675
+ # to the latest version on continue-as-new or {ContinueAsNewVersioningBehavior::USE_RAMPING_VERSION} to start on
676
+ # the task queue's Ramping Version. This is currently experimental.
676
677
  def initialize(
677
678
  *args,
678
679
  workflow: nil,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: temporalio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Temporal Technologies Inc
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  - !ruby/object:Gem::Version
281
281
  version: '0'
282
282
  requirements: []
283
- rubygems_version: 4.0.6
283
+ rubygems_version: 4.0.10
284
284
  specification_version: 4
285
285
  summary: Temporal.io Ruby SDK
286
286
  test_files: []