hatchet-sdk 0.12.4 → 0.13.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 +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/hatchet/batch.rb +6 -6
- data/lib/hatchet/clients/rest/.openapi-generator/FILES +5 -0
- data/lib/hatchet/clients/rest/README.md +11 -6
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/api_token_api.rb +71 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/concurrency_api.rb +71 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/tenant_api.rb +71 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/api_token.rb +16 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/create_api_token_request.rb +32 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role.rb +321 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role_list.rb +239 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability.rb +341 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability_list.rb +239 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_key.rb +1 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy.rb +1 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_totals.rb +320 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +5 -0
- data/lib/hatchet/contracts/v1/workflows_pb.rb +1 -1
- data/lib/hatchet/task.rb +12 -0
- data/lib/hatchet/version.rb +1 -1
- data/lib/hatchet/workflow.rb +1 -0
- data/sig/hatchet/task.rbs +2 -0
- metadata +7 -2
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Hatchet API
|
|
3
|
+
|
|
4
|
+
#The Hatchet API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module HatchetSdkRest
|
|
17
|
+
# Tenant-wide counts. A run in a chain of strategies holds a slot in each of them, so these are not the sums of the per-strategy counts.
|
|
18
|
+
class V1ConcurrencyTotals
|
|
19
|
+
# Keys with a slot in use or a queued run, across all strategies.
|
|
20
|
+
attr_accessor :key_count
|
|
21
|
+
|
|
22
|
+
# Keys with at least one queued run, across all strategies.
|
|
23
|
+
attr_accessor :queued_key_count
|
|
24
|
+
|
|
25
|
+
# Runs that passed every strategy of their chain, each counted once.
|
|
26
|
+
attr_accessor :running_count
|
|
27
|
+
|
|
28
|
+
# Runs waiting at a strategy. A run waits at one strategy at a time.
|
|
29
|
+
attr_accessor :queued_count
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'key_count' => :'keyCount',
|
|
35
|
+
:'queued_key_count' => :'queuedKeyCount',
|
|
36
|
+
:'running_count' => :'runningCount',
|
|
37
|
+
:'queued_count' => :'queuedCount'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns attribute mapping this model knows about
|
|
42
|
+
def self.acceptable_attribute_map
|
|
43
|
+
attribute_map
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns all the JSON keys this model knows about
|
|
47
|
+
def self.acceptable_attributes
|
|
48
|
+
acceptable_attribute_map.values
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.openapi_types
|
|
53
|
+
{
|
|
54
|
+
:'key_count' => :'Integer',
|
|
55
|
+
:'queued_key_count' => :'Integer',
|
|
56
|
+
:'running_count' => :'Integer',
|
|
57
|
+
:'queued_count' => :'Integer'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::V1ConcurrencyTotals` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::V1ConcurrencyTotals`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'key_count')
|
|
84
|
+
self.key_count = attributes[:'key_count']
|
|
85
|
+
else
|
|
86
|
+
self.key_count = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'queued_key_count')
|
|
90
|
+
self.queued_key_count = attributes[:'queued_key_count']
|
|
91
|
+
else
|
|
92
|
+
self.queued_key_count = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'running_count')
|
|
96
|
+
self.running_count = attributes[:'running_count']
|
|
97
|
+
else
|
|
98
|
+
self.running_count = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'queued_count')
|
|
102
|
+
self.queued_count = attributes[:'queued_count']
|
|
103
|
+
else
|
|
104
|
+
self.queued_count = nil
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
109
|
+
# @return Array for valid properties with the reasons
|
|
110
|
+
def list_invalid_properties
|
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
if @key_count.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "key_count", key_count cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @queued_key_count.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "queued_key_count", queued_key_count cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @running_count.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "running_count", running_count cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if @queued_count.nil?
|
|
126
|
+
invalid_properties.push('invalid value for "queued_count", queued_count cannot be nil.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
invalid_properties
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Check to see if the all the properties in the model are valid
|
|
133
|
+
# @return true if the model is valid
|
|
134
|
+
def valid?
|
|
135
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
|
+
return false if @key_count.nil?
|
|
137
|
+
return false if @queued_key_count.nil?
|
|
138
|
+
return false if @running_count.nil?
|
|
139
|
+
return false if @queued_count.nil?
|
|
140
|
+
true
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] key_count Value to be assigned
|
|
145
|
+
def key_count=(key_count)
|
|
146
|
+
if key_count.nil?
|
|
147
|
+
fail ArgumentError, 'key_count cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@key_count = key_count
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Custom attribute writer method with validation
|
|
154
|
+
# @param [Object] queued_key_count Value to be assigned
|
|
155
|
+
def queued_key_count=(queued_key_count)
|
|
156
|
+
if queued_key_count.nil?
|
|
157
|
+
fail ArgumentError, 'queued_key_count cannot be nil'
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
@queued_key_count = queued_key_count
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Custom attribute writer method with validation
|
|
164
|
+
# @param [Object] running_count Value to be assigned
|
|
165
|
+
def running_count=(running_count)
|
|
166
|
+
if running_count.nil?
|
|
167
|
+
fail ArgumentError, 'running_count cannot be nil'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
@running_count = running_count
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] queued_count Value to be assigned
|
|
175
|
+
def queued_count=(queued_count)
|
|
176
|
+
if queued_count.nil?
|
|
177
|
+
fail ArgumentError, 'queued_count cannot be nil'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
@queued_count = queued_count
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Checks equality by comparing each attribute.
|
|
184
|
+
# @param [Object] Object to be compared
|
|
185
|
+
def ==(o)
|
|
186
|
+
return true if self.equal?(o)
|
|
187
|
+
self.class == o.class &&
|
|
188
|
+
key_count == o.key_count &&
|
|
189
|
+
queued_key_count == o.queued_key_count &&
|
|
190
|
+
running_count == o.running_count &&
|
|
191
|
+
queued_count == o.queued_count
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# @see the `==` method
|
|
195
|
+
# @param [Object] Object to be compared
|
|
196
|
+
def eql?(o)
|
|
197
|
+
self == o
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Calculates hash code according to all attributes.
|
|
201
|
+
# @return [Integer] Hash code
|
|
202
|
+
def hash
|
|
203
|
+
[key_count, queued_key_count, running_count, queued_count].hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Builds the object from hash
|
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
208
|
+
# @return [Object] Returns the model itself
|
|
209
|
+
def self.build_from_hash(attributes)
|
|
210
|
+
return nil unless attributes.is_a?(Hash)
|
|
211
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
212
|
+
transformed_hash = {}
|
|
213
|
+
openapi_types.each_pair do |key, type|
|
|
214
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
215
|
+
transformed_hash["#{key}"] = nil
|
|
216
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
217
|
+
# check to ensure the input is an array given that the attribute
|
|
218
|
+
# is documented as an array but the input is not
|
|
219
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
220
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
221
|
+
end
|
|
222
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
223
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
new(transformed_hash)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Deserializes the data based on type
|
|
230
|
+
# @param string type Data type
|
|
231
|
+
# @param string value Value to be deserialized
|
|
232
|
+
# @return [Object] Deserialized data
|
|
233
|
+
def self._deserialize(type, value)
|
|
234
|
+
case type.to_sym
|
|
235
|
+
when :Time
|
|
236
|
+
Time.parse(value)
|
|
237
|
+
when :Date
|
|
238
|
+
Date.parse(value)
|
|
239
|
+
when :String
|
|
240
|
+
value.to_s
|
|
241
|
+
when :Integer
|
|
242
|
+
value.to_i
|
|
243
|
+
when :Float
|
|
244
|
+
value.to_f
|
|
245
|
+
when :Boolean
|
|
246
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
247
|
+
true
|
|
248
|
+
else
|
|
249
|
+
false
|
|
250
|
+
end
|
|
251
|
+
when :Object
|
|
252
|
+
# generic object (usually a Hash), return directly
|
|
253
|
+
value
|
|
254
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
255
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
256
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
257
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
258
|
+
k_type = Regexp.last_match[:k_type]
|
|
259
|
+
v_type = Regexp.last_match[:v_type]
|
|
260
|
+
{}.tap do |hash|
|
|
261
|
+
value.each do |k, v|
|
|
262
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
else # model
|
|
266
|
+
# models (e.g. Pet) or oneOf
|
|
267
|
+
klass = HatchetSdkRest.const_get(type)
|
|
268
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Returns the string representation of the object
|
|
273
|
+
# @return [String] String presentation of the object
|
|
274
|
+
def to_s
|
|
275
|
+
to_hash.to_s
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
279
|
+
# @return [Hash] Returns the object in the form of hash
|
|
280
|
+
def to_body
|
|
281
|
+
to_hash
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Returns the object in the form of hash
|
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
|
286
|
+
def to_hash
|
|
287
|
+
hash = {}
|
|
288
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
289
|
+
value = self.send(attr)
|
|
290
|
+
if value.nil?
|
|
291
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
292
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
hash[param] = _to_hash(value)
|
|
296
|
+
end
|
|
297
|
+
hash
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Outputs non-array value in the form of hash
|
|
301
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
302
|
+
# @param [Object] value Any valid value
|
|
303
|
+
# @return [Hash] Returns the value in the form of hash
|
|
304
|
+
def _to_hash(value)
|
|
305
|
+
if value.is_a?(Array)
|
|
306
|
+
value.compact.map { |v| _to_hash(v) }
|
|
307
|
+
elsif value.is_a?(Hash)
|
|
308
|
+
{}.tap do |hash|
|
|
309
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
310
|
+
end
|
|
311
|
+
elsif value.respond_to? :to_hash
|
|
312
|
+
value.to_hash
|
|
313
|
+
else
|
|
314
|
+
value
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
end
|
|
@@ -136,8 +136,12 @@ HatchetSdkRest.autoload :TenantQueueMetrics, 'hatchet-sdk-rest/models/tenant_que
|
|
|
136
136
|
HatchetSdkRest.autoload :TenantResource, 'hatchet-sdk-rest/models/tenant_resource'
|
|
137
137
|
HatchetSdkRest.autoload :TenantResourceLimit, 'hatchet-sdk-rest/models/tenant_resource_limit'
|
|
138
138
|
HatchetSdkRest.autoload :TenantResourcePolicy, 'hatchet-sdk-rest/models/tenant_resource_policy'
|
|
139
|
+
HatchetSdkRest.autoload :TenantRole, 'hatchet-sdk-rest/models/tenant_role'
|
|
140
|
+
HatchetSdkRest.autoload :TenantRoleList, 'hatchet-sdk-rest/models/tenant_role_list'
|
|
139
141
|
HatchetSdkRest.autoload :TenantStepRunQueueMetrics, 'hatchet-sdk-rest/models/tenant_step_run_queue_metrics'
|
|
140
142
|
HatchetSdkRest.autoload :TenantVersion, 'hatchet-sdk-rest/models/tenant_version'
|
|
143
|
+
HatchetSdkRest.autoload :TokenCapability, 'hatchet-sdk-rest/models/token_capability'
|
|
144
|
+
HatchetSdkRest.autoload :TokenCapabilityList, 'hatchet-sdk-rest/models/token_capability_list'
|
|
141
145
|
HatchetSdkRest.autoload :TriggerRunResult, 'hatchet-sdk-rest/models/trigger_run_result'
|
|
142
146
|
HatchetSdkRest.autoload :TriggerWorkflowRunRequest, 'hatchet-sdk-rest/models/trigger_workflow_run_request'
|
|
143
147
|
HatchetSdkRest.autoload :UpdateCronWorkflowTriggerRequest, 'hatchet-sdk-rest/models/update_cron_workflow_trigger_request'
|
|
@@ -169,6 +173,7 @@ HatchetSdkRest.autoload :V1ConcurrencyScope, 'hatchet-sdk-rest/models/v1_concurr
|
|
|
169
173
|
HatchetSdkRest.autoload :V1ConcurrencyStrategy, 'hatchet-sdk-rest/models/v1_concurrency_strategy'
|
|
170
174
|
HatchetSdkRest.autoload :V1ConcurrencyStrategyList, 'hatchet-sdk-rest/models/v1_concurrency_strategy_list'
|
|
171
175
|
HatchetSdkRest.autoload :V1ConcurrencyStrategyUsage, 'hatchet-sdk-rest/models/v1_concurrency_strategy_usage'
|
|
176
|
+
HatchetSdkRest.autoload :V1ConcurrencyTotals, 'hatchet-sdk-rest/models/v1_concurrency_totals'
|
|
172
177
|
HatchetSdkRest.autoload :V1CreateFilterRequest, 'hatchet-sdk-rest/models/v1_create_filter_request'
|
|
173
178
|
HatchetSdkRest.autoload :V1CreateServerlessEndpointRequest, 'hatchet-sdk-rest/models/v1_create_serverless_endpoint_request'
|
|
174
179
|
HatchetSdkRest.autoload :V1CreateWebhookRequest, 'hatchet-sdk-rest/models/v1_create_webhook_request'
|
|
@@ -9,7 +9,7 @@ require 'v1/shared/condition_pb'
|
|
|
9
9
|
require 'v1/shared/trigger_pb'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
descriptor_data = "\n\x12v1/workflows.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19v1/shared/condition.proto\x1a\x17v1/shared/trigger.proto\"[\n\x12\x43\x61ncelTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"[\n\x12ReplayTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"\xb7\x01\n\x0bTasksFilter\x12\x10\n\x08statuses\x18\x01 \x03(\t\x12)\n\x05since\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\x05until\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x12\x14\n\x0cworkflow_ids\x18\x04 \x03(\t\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x05 \x03(\tB\x08\n\x06_until\".\n\x13\x43\x61ncelTasksResponse\x12\x17\n\x0f\x63\x61ncelled_tasks\x18\x01 \x03(\t\"-\n\x13ReplayTasksResponse\x12\x16\n\x0ereplayed_tasks\x18\x01 \x03(\t\"\xae\x02\n\x19TriggerWorkflowRunRequest\x12\x15\n\rworkflow_name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\x0c\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x03 \x01(\x0c\x12\x15\n\x08priority\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12U\n\x15\x64\x65sired_worker_labels\x18\x05 \x03(\x0b\x32\x36.v1.TriggerWorkflowRunRequest.DesiredWorkerLabelsEntry\x1aS\n\x18\x44\x65siredWorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x42\x0b\n\t_priority\"1\n\x1aTriggerWorkflowRunResponse\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\"X\n\x18\x42ranchDurableTaskRequest\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"Y\n\x19\x42ranchDurableTaskResponse\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"\xed\x04\n\x1c\x43reateWorkflowVersionRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12!\n\x05tasks\x18\x06 \x03(\x0b\x32\x12.v1.CreateTaskOpts\x12$\n\x0b\x63oncurrency\x18\x07 \x01(\x0b\x32\x0f.v1.Concurrency\x12\x17\n\ncron_input\x18\x08 \x01(\tH\x00\x88\x01\x01\x12\x30\n\x0fon_failure_task\x18\t \x01(\x0b\x32\x12.v1.CreateTaskOptsH\x01\x88\x01\x01\x12\'\n\x06sticky\x18\n \x01(\x0e\x32\x12.v1.StickyStrategyH\x02\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0b \x01(\x05H\x03\x88\x01\x01\x12(\n\x0f\x63oncurrency_arr\x18\x0c \x03(\x0b\x32\x0f.v1.Concurrency\x12*\n\x0f\x64\x65\x66\x61ult_filters\x18\r \x03(\x0b\x32\x11.v1.DefaultFilter\x12\x1e\n\x11input_json_schema\x18\x0e \x01(\x0cH\x04\x88\x01\x01\x12/\n\x0bidempotency\x18\x0f \x01(\x0b\x32\x15.v1.IdempotencyConfigH\x05\x88\x01\x01\x42\r\n\x0b_cron_inputB\x12\n\x10_on_failure_taskB\t\n\x07_stickyB\x13\n\x11_default_priorityB\x14\n\x12_input_json_schemaB\x0e\n\x0c_idempotency\"n\n\x11IdempotencyConfig\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x0e\n\x06ttl_ms\x18\x02 \x01(\x03\x12*\n\x06method\x18\x03 \x01(\x0e\x32\x15.v1.IdempotencyMethodH\x00\x88\x01\x01\x42\t\n\x07_method\"`\n\x19IdempotencyCollisionError\x12 \n\x18\x65xisting_run_external_id\x18\x01 \x01(\t\x12!\n\x19\x63olliding_run_external_id\x18\x02 \x01(\t\"\x87\x01\n$BulkTriggerIdempotencyCollisionError\x12,\n$successful_workflow_run_external_ids\x18\x01 \x03(\t\x12\x31\n\ncollisions\x18\x02 \x03(\x0b\x32\x1d.v1.IdempotencyCollisionError\"T\n\rDefaultFilter\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\x12\x14\n\x07payload\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\n\n\x08_payload\"\x9d\x02\n\x0b\x43oncurrency\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x39\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x1c.v1.ConcurrencyLimitStrategyH\x01\x88\x01\x01\x12\x11\n\x04name\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10is_tenant_scoped\x18\x05 \x01(\x08H\x03\x88\x01\x01\x12 \n\x13max_runs_expression\x18\x06 \x01(\tH\x04\x88\x01\x01\x42\x0b\n\t_max_runsB\x11\n\x0f_limit_strategyB\x07\n\x05_nameB\x13\n\x11_is_tenant_scopedB\x16\n\x14_max_runs_expression\"\x89\x02\n\x0fTaskBatchConfig\x12\x16\n\x0e\x62\x61tch_max_size\x18\x01 \x01(\x05\x12\"\n\x15\x62\x61tch_max_interval_ms\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x1c\n\x0f\x62\x61tch_group_key\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x62\x61tch_group_max_runs\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x1d\n\x10\x62roadcast_output\x18\x05 \x01(\x08H\x03\x88\x01\x01\x42\x18\n\x16_batch_max_interval_msB\x12\n\x10_batch_group_keyB\x17\n\x15_batch_group_max_runsB\x13\n\x11_broadcast_output\"\
|
|
12
|
+
descriptor_data = "\n\x12v1/workflows.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19v1/shared/condition.proto\x1a\x17v1/shared/trigger.proto\"[\n\x12\x43\x61ncelTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"[\n\x12ReplayTasksRequest\x12\x14\n\x0c\x65xternal_ids\x18\x01 \x03(\t\x12$\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0f.v1.TasksFilterH\x00\x88\x01\x01\x42\t\n\x07_filter\"\xb7\x01\n\x0bTasksFilter\x12\x10\n\x08statuses\x18\x01 \x03(\t\x12)\n\x05since\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\x05until\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x12\x14\n\x0cworkflow_ids\x18\x04 \x03(\t\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x05 \x03(\tB\x08\n\x06_until\".\n\x13\x43\x61ncelTasksResponse\x12\x17\n\x0f\x63\x61ncelled_tasks\x18\x01 \x03(\t\"-\n\x13ReplayTasksResponse\x12\x16\n\x0ereplayed_tasks\x18\x01 \x03(\t\"\xae\x02\n\x19TriggerWorkflowRunRequest\x12\x15\n\rworkflow_name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\x0c\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x03 \x01(\x0c\x12\x15\n\x08priority\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12U\n\x15\x64\x65sired_worker_labels\x18\x05 \x03(\x0b\x32\x36.v1.TriggerWorkflowRunRequest.DesiredWorkerLabelsEntry\x1aS\n\x18\x44\x65siredWorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x42\x0b\n\t_priority\"1\n\x1aTriggerWorkflowRunResponse\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\"X\n\x18\x42ranchDurableTaskRequest\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"Y\n\x19\x42ranchDurableTaskResponse\x12\x18\n\x10task_external_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x03\x12\x11\n\tbranch_id\x18\x03 \x01(\x03\"\xed\x04\n\x1c\x43reateWorkflowVersionRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12!\n\x05tasks\x18\x06 \x03(\x0b\x32\x12.v1.CreateTaskOpts\x12$\n\x0b\x63oncurrency\x18\x07 \x01(\x0b\x32\x0f.v1.Concurrency\x12\x17\n\ncron_input\x18\x08 \x01(\tH\x00\x88\x01\x01\x12\x30\n\x0fon_failure_task\x18\t \x01(\x0b\x32\x12.v1.CreateTaskOptsH\x01\x88\x01\x01\x12\'\n\x06sticky\x18\n \x01(\x0e\x32\x12.v1.StickyStrategyH\x02\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0b \x01(\x05H\x03\x88\x01\x01\x12(\n\x0f\x63oncurrency_arr\x18\x0c \x03(\x0b\x32\x0f.v1.Concurrency\x12*\n\x0f\x64\x65\x66\x61ult_filters\x18\r \x03(\x0b\x32\x11.v1.DefaultFilter\x12\x1e\n\x11input_json_schema\x18\x0e \x01(\x0cH\x04\x88\x01\x01\x12/\n\x0bidempotency\x18\x0f \x01(\x0b\x32\x15.v1.IdempotencyConfigH\x05\x88\x01\x01\x42\r\n\x0b_cron_inputB\x12\n\x10_on_failure_taskB\t\n\x07_stickyB\x13\n\x11_default_priorityB\x14\n\x12_input_json_schemaB\x0e\n\x0c_idempotency\"n\n\x11IdempotencyConfig\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x0e\n\x06ttl_ms\x18\x02 \x01(\x03\x12*\n\x06method\x18\x03 \x01(\x0e\x32\x15.v1.IdempotencyMethodH\x00\x88\x01\x01\x42\t\n\x07_method\"`\n\x19IdempotencyCollisionError\x12 \n\x18\x65xisting_run_external_id\x18\x01 \x01(\t\x12!\n\x19\x63olliding_run_external_id\x18\x02 \x01(\t\"\x87\x01\n$BulkTriggerIdempotencyCollisionError\x12,\n$successful_workflow_run_external_ids\x18\x01 \x03(\t\x12\x31\n\ncollisions\x18\x02 \x03(\x0b\x32\x1d.v1.IdempotencyCollisionError\"T\n\rDefaultFilter\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\x12\x14\n\x07payload\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\n\n\x08_payload\"\x9d\x02\n\x0b\x43oncurrency\x12\x12\n\nexpression\x18\x01 \x01(\t\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x39\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x1c.v1.ConcurrencyLimitStrategyH\x01\x88\x01\x01\x12\x11\n\x04name\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10is_tenant_scoped\x18\x05 \x01(\x08H\x03\x88\x01\x01\x12 \n\x13max_runs_expression\x18\x06 \x01(\tH\x04\x88\x01\x01\x42\x0b\n\t_max_runsB\x11\n\x0f_limit_strategyB\x07\n\x05_nameB\x13\n\x11_is_tenant_scopedB\x16\n\x14_max_runs_expression\"\x89\x02\n\x0fTaskBatchConfig\x12\x16\n\x0e\x62\x61tch_max_size\x18\x01 \x01(\x05\x12\"\n\x15\x62\x61tch_max_interval_ms\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x1c\n\x0f\x62\x61tch_group_key\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x62\x61tch_group_max_runs\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x1d\n\x10\x62roadcast_output\x18\x05 \x01(\x08H\x03\x88\x01\x01\x42\x18\n\x16_batch_max_interval_msB\x12\n\x10_batch_group_keyB\x17\n\x15_batch_group_max_runsB\x13\n\x11_broadcast_output\"\xb0\x06\n\x0e\x43reateTaskOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x0f\n\x07retries\x18\x06 \x01(\x05\x12,\n\x0brate_limits\x18\x07 \x03(\x0b\x32\x17.v1.CreateTaskRateLimit\x12;\n\rworker_labels\x18\x08 \x03(\x0b\x32$.v1.CreateTaskOpts.WorkerLabelsEntry\x12\x1b\n\x0e\x62\x61\x63koff_factor\x18\t \x01(\x02H\x00\x88\x01\x01\x12 \n\x13\x62\x61\x63koff_max_seconds\x18\n \x01(\x05H\x01\x88\x01\x01\x12$\n\x0b\x63oncurrency\x18\x0b \x03(\x0b\x32\x0f.v1.Concurrency\x12+\n\nconditions\x18\x0c \x01(\x0b\x32\x12.v1.TaskConditionsH\x02\x88\x01\x01\x12\x1d\n\x10schedule_timeout\x18\r \x01(\tH\x03\x88\x01\x01\x12\x12\n\nis_durable\x18\x0e \x01(\x08\x12;\n\rslot_requests\x18\x0f \x03(\x0b\x32$.v1.CreateTaskOpts.SlotRequestsEntry\x12\'\n\x05\x62\x61tch\x18\x10 \x01(\x0b\x32\x13.v1.TaskBatchConfigH\x04\x88\x01\x01\x12&\n\x19max_reassignments_allowed\x18\x11 \x01(\x05H\x05\x88\x01\x01\x1aL\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x1a\x33\n\x11SlotRequestsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x42\x11\n\x0f_backoff_factorB\x16\n\x14_backoff_max_secondsB\r\n\x0b_conditionsB\x13\n\x11_schedule_timeoutB\x08\n\x06_batchB\x1c\n\x1a_max_reassignments_allowed\"\xfd\x01\n\x13\x43reateTaskRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x12\n\x05units\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08key_expr\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nunits_expr\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1e\n\x11limit_values_expr\x18\x05 \x01(\tH\x03\x88\x01\x01\x12,\n\x08\x64uration\x18\x06 \x01(\x0e\x32\x15.v1.RateLimitDurationH\x04\x88\x01\x01\x42\x08\n\x06_unitsB\x0b\n\t_key_exprB\r\n\x0b_units_exprB\x14\n\x12_limit_values_exprB\x0b\n\t_duration\"@\n\x1d\x43reateWorkflowVersionResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\"+\n\x14GetRunDetailsRequest\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\"\xaa\x01\n\rTaskRunDetail\x12\x13\n\x0b\x65xternal_id\x18\x01 \x01(\t\x12\x1d\n\x06status\x18\x02 \x01(\x0e\x32\r.v1.RunStatus\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x04 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x0breadable_id\x18\x05 \x01(\t\x12\x12\n\nis_evicted\x18\x06 \x01(\x08\x42\x08\n\x06_errorB\t\n\x07_output\"\x84\x02\n\x15GetRunDetailsResponse\x12\r\n\x05input\x18\x01 \x01(\x0c\x12\x1d\n\x06status\x18\x02 \x01(\x0e\x32\r.v1.RunStatus\x12:\n\ttask_runs\x18\x03 \x03(\x0b\x32\'.v1.GetRunDetailsResponse.TaskRunsEntry\x12\x0c\n\x04\x64one\x18\x04 \x01(\x08\x12\x1b\n\x13\x61\x64\x64itional_metadata\x18\x05 \x01(\x0c\x12\x12\n\nis_evicted\x18\x06 \x01(\x08\x1a\x42\n\rTaskRunsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.v1.TaskRunDetail:\x02\x38\x01*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06*[\n\tRunStatus\x12\n\n\x06QUEUED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tCOMPLETED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0b\n\x07\x45VICTED\x10\x05*(\n\x11IdempotencyMethod\x12\x07\n\x03TTL\x10\x00\x12\n\n\x06STATUS\x10\x01*\xc1\x01\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03\x12\x11\n\rCANCEL_NEWEST\x10\x04\x12\x1f\n\x1b\x43\x41NCEL_QUEUED_EXCEPT_NEWEST\x10\x05\x12\x1f\n\x1b\x43\x41NCEL_QUEUED_EXCEPT_OLDEST\x10\x06\x32\xcf\x03\n\x0c\x41\x64minService\x12R\n\x0bPutWorkflow\x12 .v1.CreateWorkflowVersionRequest\x1a!.v1.CreateWorkflowVersionResponse\x12>\n\x0b\x43\x61ncelTasks\x12\x16.v1.CancelTasksRequest\x1a\x17.v1.CancelTasksResponse\x12>\n\x0bReplayTasks\x12\x16.v1.ReplayTasksRequest\x1a\x17.v1.ReplayTasksResponse\x12S\n\x12TriggerWorkflowRun\x12\x1d.v1.TriggerWorkflowRunRequest\x1a\x1e.v1.TriggerWorkflowRunResponse\x12\x44\n\rGetRunDetails\x12\x18.v1.GetRunDetailsRequest\x1a\x19.v1.GetRunDetailsResponse\x12P\n\x11\x42ranchDurableTask\x12\x1c.v1.BranchDurableTaskRequest\x1a\x1d.v1.BranchDurableTaskResponseBBZ@github.com/hatchet-dev/hatchet/internal/services/shared/proto/v1b\x06proto3"
|
|
13
13
|
|
|
14
14
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
15
15
|
pool.add_serialized_file(descriptor_data)
|
data/lib/hatchet/task.rb
CHANGED
|
@@ -47,6 +47,9 @@ module Hatchet
|
|
|
47
47
|
# @return [Float, nil] Backoff factor between retries
|
|
48
48
|
attr_reader :backoff_factor
|
|
49
49
|
|
|
50
|
+
# @return [Integer, nil] Maximum number of times the task can be reassigned to a new worker before failing
|
|
51
|
+
attr_reader :max_reassignments_allowed
|
|
52
|
+
|
|
50
53
|
# @return [Array<RateLimit>] Rate limits applied to this task
|
|
51
54
|
attr_reader :rate_limits
|
|
52
55
|
|
|
@@ -90,6 +93,7 @@ module Hatchet
|
|
|
90
93
|
# @param retries [Integer, nil] Max retries
|
|
91
94
|
# @param backoff_max_seconds [Integer, nil] Max backoff seconds
|
|
92
95
|
# @param backoff_factor [Float, nil] Backoff multiplier
|
|
96
|
+
# @param max_reassignments_allowed [Integer, nil] Max reassignments to a new worker before failing. Must be 0 or more.
|
|
93
97
|
# @param rate_limits [Array<RateLimit>] Rate limits
|
|
94
98
|
# @param concurrency [Array<ConcurrencyExpression>, ConcurrencyExpression, nil]
|
|
95
99
|
# @param desired_worker_labels [Hash, nil]
|
|
@@ -108,6 +112,7 @@ module Hatchet
|
|
|
108
112
|
retries: nil,
|
|
109
113
|
backoff_max_seconds: nil,
|
|
110
114
|
backoff_factor: nil,
|
|
115
|
+
max_reassignments_allowed: nil,
|
|
111
116
|
rate_limits: [],
|
|
112
117
|
concurrency: nil,
|
|
113
118
|
desired_worker_labels: nil,
|
|
@@ -121,6 +126,10 @@ module Hatchet
|
|
|
121
126
|
deps: nil,
|
|
122
127
|
&block
|
|
123
128
|
)
|
|
129
|
+
if !max_reassignments_allowed.nil? && max_reassignments_allowed.negative?
|
|
130
|
+
raise ArgumentError, "max_reassignments_allowed must be 0 or more; got #{max_reassignments_allowed}"
|
|
131
|
+
end
|
|
132
|
+
|
|
124
133
|
@name = name.to_sym
|
|
125
134
|
@parents = parents
|
|
126
135
|
@execution_timeout = execution_timeout
|
|
@@ -128,6 +137,7 @@ module Hatchet
|
|
|
128
137
|
@retries = retries
|
|
129
138
|
@backoff_max_seconds = backoff_max_seconds
|
|
130
139
|
@backoff_factor = backoff_factor
|
|
140
|
+
@max_reassignments_allowed = max_reassignments_allowed
|
|
131
141
|
@rate_limits = rate_limits
|
|
132
142
|
@concurrency = concurrency
|
|
133
143
|
@desired_worker_labels = desired_worker_labels
|
|
@@ -184,6 +194,8 @@ module Hatchet
|
|
|
184
194
|
opts[:backoff_factor] = @backoff_factor if @backoff_factor
|
|
185
195
|
opts[:backoff_max_seconds] = @backoff_max_seconds if @backoff_max_seconds
|
|
186
196
|
|
|
197
|
+
opts[:max_reassignments_allowed] = @max_reassignments_allowed unless @max_reassignments_allowed.nil?
|
|
198
|
+
|
|
187
199
|
# Task-level concurrency
|
|
188
200
|
if @concurrency
|
|
189
201
|
conc_list = @concurrency.is_a?(Array) ? @concurrency : [@concurrency]
|
data/lib/hatchet/version.rb
CHANGED
data/lib/hatchet/workflow.rb
CHANGED
|
@@ -109,6 +109,7 @@ module Hatchet
|
|
|
109
109
|
# @option opts [Integer, nil] :retries (nil) The number of times to retry the task before failing
|
|
110
110
|
# @option opts [Float, nil] :backoff_factor (nil) The backoff factor for controlling exponential backoff in retries
|
|
111
111
|
# @option opts [Integer, nil] :backoff_max_seconds (nil) The maximum number of seconds to allow retries with exponential backoff to continue
|
|
112
|
+
# @option opts [Integer, nil] :max_reassignments_allowed (nil) The maximum number of times the task can be reassigned to a new worker (when its worker stops heartbeating or never acknowledges the assignment) before failing. +0+ means the task is never reassigned. Defaults to the server's limit, which also caps this value
|
|
112
113
|
# @option opts [Array<RateLimit>] :rate_limits ([]) A list of rate limit configurations for the task
|
|
113
114
|
# @option opts [ConcurrencyExpression, Array<ConcurrencyExpression>, nil] :concurrency (nil) A concurrency expression (or list of them) controlling the concurrency settings for this task
|
|
114
115
|
# @option opts [Hash, nil] :desired_worker_labels (nil) A hash of desired worker labels that determine to which worker the task should be assigned
|
data/sig/hatchet/task.rbs
CHANGED
|
@@ -7,6 +7,7 @@ module Hatchet
|
|
|
7
7
|
attr_reader retries: Integer?
|
|
8
8
|
attr_reader backoff_max_seconds: Integer?
|
|
9
9
|
attr_reader backoff_factor: Float?
|
|
10
|
+
attr_reader max_reassignments_allowed: Integer?
|
|
10
11
|
attr_reader rate_limits: Array[RateLimit]
|
|
11
12
|
attr_reader concurrency: Array[ConcurrencyExpression] | ConcurrencyExpression | nil
|
|
12
13
|
attr_reader desired_worker_labels: Hash[Symbol, untyped]?
|
|
@@ -28,6 +29,7 @@ module Hatchet
|
|
|
28
29
|
?retries: Integer?,
|
|
29
30
|
?backoff_max_seconds: Integer?,
|
|
30
31
|
?backoff_factor: Float?,
|
|
32
|
+
?max_reassignments_allowed: Integer?,
|
|
31
33
|
?rate_limits: Array[RateLimit],
|
|
32
34
|
?concurrency: Array[ConcurrencyExpression] | ConcurrencyExpression | nil,
|
|
33
35
|
?desired_worker_labels: Hash[Symbol, untyped]?,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hatchet-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- gabriel ruttner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -356,8 +356,12 @@ files:
|
|
|
356
356
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_resource.rb
|
|
357
357
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_resource_limit.rb
|
|
358
358
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_resource_policy.rb
|
|
359
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role.rb
|
|
360
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role_list.rb
|
|
359
361
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_step_run_queue_metrics.rb
|
|
360
362
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_version.rb
|
|
363
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability.rb
|
|
364
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability_list.rb
|
|
361
365
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/trigger_run_result.rb
|
|
362
366
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/trigger_workflow_run_request.rb
|
|
363
367
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_cron_workflow_trigger_request.rb
|
|
@@ -389,6 +393,7 @@ files:
|
|
|
389
393
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy.rb
|
|
390
394
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy_list.rb
|
|
391
395
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy_usage.rb
|
|
396
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_totals.rb
|
|
392
397
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_filter_request.rb
|
|
393
398
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_serverless_endpoint_request.rb
|
|
394
399
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request.rb
|