hatchet-sdk 0.8.0 → 0.9.0
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 +13 -0
- data/lib/hatchet/clients/rest/.openapi-generator/FILES +0 -5
- data/lib/hatchet/clients/rest/README.md +0 -9
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +0 -5
- data/lib/hatchet/contracts/dispatcher/dispatcher_pb.rb +1 -1
- data/lib/hatchet/features/workflows.rb +45 -0
- data/lib/hatchet/version.rb +1 -1
- data/lib/hatchet/worker/durable_event_listener.rb +71 -20
- data/lib/hatchet/workflow.rb +23 -0
- data/sig/hatchet/worker/durable_event_listener.rbs +3 -0
- metadata +2 -7
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/operator_api.rb +0 -405
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_http_operator_request.rb +0 -346
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator.rb +0 -372
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator_list.rb +0 -231
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_http_operator_request.rb +0 -252
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf12b2683a7b26125e459a66b28acfa0d0c04cc5a4b148cadcce6a29f69b53ea
|
|
4
|
+
data.tar.gz: ea2fc0114f0a8d236d899b1713c85e5383bf83ab19cc0099020d680f35501db0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd9e284829bb0ede7127685699cd79e0c5283d693aee9bc5e6e201cd2518e20c08e83e884054a3325bda3c0435e5743ff35137f6ebb44cbeea9383b83617250b
|
|
7
|
+
data.tar.gz: 7ac930e2413632481a339e892cbc932fc205d15c6012a2f9e4ea43fe002282c40a24a6f47d555c1fd222c285ee16a2c5155595a2405c89fd3c975ce86e77a32c
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to Hatchet's Ruby SDK will be documented in this changelog.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.9.0] - 2026-09-23
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added `pause` and `unpause` methods to the workflows client (`hatchet.workflows.pause(workflow_id, queue_ttl:)`) and to workflows (`workflow.pause(queue_ttl:)`). `queue_ttl` is how long runs stay queued while the workflow is paused, in seconds or as a duration string, and the behavior (`QUEUE` or `DROP`) for cron and scheduled runs triggered while paused can optionally be set, both defaulting to `QUEUE`.
|
|
13
|
+
|
|
14
|
+
## [0.8.1] - 2026-10-05
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- [Durable tasks](https://docs.hatchet.run/v1/durable-tasks) with many concurrent waits no longer flood the engine with worker status requests. The durable listener sent one worker status request per wait, each listing every pending wait, which was quadratic in the number of waits; each request now lists only the waits registered since the previous one.
|
|
19
|
+
- The periodic worker status request lists only waits that have been pending for more than two seconds, is sent every five seconds instead of every second, and is split into requests of at most 10,000 entries so it stays under the gRPC message size limit.
|
|
20
|
+
|
|
8
21
|
## [0.8.0] - 2026-09-02
|
|
9
22
|
|
|
10
23
|
### Added
|
|
@@ -21,7 +21,6 @@ lib/hatchet-sdk-rest/api/healthcheck_api.rb
|
|
|
21
21
|
lib/hatchet-sdk-rest/api/log_api.rb
|
|
22
22
|
lib/hatchet-sdk-rest/api/metadata_api.rb
|
|
23
23
|
lib/hatchet-sdk-rest/api/observability_api.rb
|
|
24
|
-
lib/hatchet-sdk-rest/api/operator_api.rb
|
|
25
24
|
lib/hatchet-sdk-rest/api/rate_limits_api.rb
|
|
26
25
|
lib/hatchet-sdk-rest/api/slack_api.rb
|
|
27
26
|
lib/hatchet-sdk-rest/api/sns_api.rb
|
|
@@ -181,7 +180,6 @@ lib/hatchet-sdk-rest/models/v1_cel_debug_request.rb
|
|
|
181
180
|
lib/hatchet-sdk-rest/models/v1_cel_debug_response.rb
|
|
182
181
|
lib/hatchet-sdk-rest/models/v1_cel_debug_response_status.rb
|
|
183
182
|
lib/hatchet-sdk-rest/models/v1_create_filter_request.rb
|
|
184
|
-
lib/hatchet-sdk-rest/models/v1_create_http_operator_request.rb
|
|
185
183
|
lib/hatchet-sdk-rest/models/v1_create_webhook_request.rb
|
|
186
184
|
lib/hatchet-sdk-rest/models/v1_create_webhook_request_api_key.rb
|
|
187
185
|
lib/hatchet-sdk-rest/models/v1_create_webhook_request_base.rb
|
|
@@ -198,8 +196,6 @@ lib/hatchet-sdk-rest/models/v1_event_triggered_run.rb
|
|
|
198
196
|
lib/hatchet-sdk-rest/models/v1_event_workflow_run_summary.rb
|
|
199
197
|
lib/hatchet-sdk-rest/models/v1_filter.rb
|
|
200
198
|
lib/hatchet-sdk-rest/models/v1_filter_list.rb
|
|
201
|
-
lib/hatchet-sdk-rest/models/v1_http_operator.rb
|
|
202
|
-
lib/hatchet-sdk-rest/models/v1_http_operator_list.rb
|
|
203
199
|
lib/hatchet-sdk-rest/models/v1_log_line.rb
|
|
204
200
|
lib/hatchet-sdk-rest/models/v1_log_line_level.rb
|
|
205
201
|
lib/hatchet-sdk-rest/models/v1_log_line_list.rb
|
|
@@ -226,7 +222,6 @@ lib/hatchet-sdk-rest/models/v1_task_timing.rb
|
|
|
226
222
|
lib/hatchet-sdk-rest/models/v1_task_timing_list.rb
|
|
227
223
|
lib/hatchet-sdk-rest/models/v1_trigger_workflow_run_request.rb
|
|
228
224
|
lib/hatchet-sdk-rest/models/v1_update_filter_request.rb
|
|
229
|
-
lib/hatchet-sdk-rest/models/v1_update_http_operator_request.rb
|
|
230
225
|
lib/hatchet-sdk-rest/models/v1_update_webhook_request.rb
|
|
231
226
|
lib/hatchet-sdk-rest/models/v1_wait_item.rb
|
|
232
227
|
lib/hatchet-sdk-rest/models/v1_webhook.rb
|
|
@@ -137,11 +137,6 @@ Class | Method | HTTP request | Description
|
|
|
137
137
|
*HatchetSdkRest::MetadataApi* | [**metadata_get**](docs/MetadataApi.md#metadata_get) | **GET** /api/v1/meta | Get metadata
|
|
138
138
|
*HatchetSdkRest::MetadataApi* | [**metadata_list_integrations**](docs/MetadataApi.md#metadata_list_integrations) | **GET** /api/v1/meta/integrations | List integrations
|
|
139
139
|
*HatchetSdkRest::ObservabilityApi* | [**v1_observability_get_trace**](docs/ObservabilityApi.md#v1_observability_get_trace) | **GET** /api/v1/stable/tenants/{tenant}/traces | Get OTel trace
|
|
140
|
-
*HatchetSdkRest::OperatorApi* | [**v1_http_operator_create**](docs/OperatorApi.md#v1_http_operator_create) | **POST** /api/v1/stable/tenants/{tenant}/operators/http | Create an HTTP operator
|
|
141
|
-
*HatchetSdkRest::OperatorApi* | [**v1_http_operator_delete**](docs/OperatorApi.md#v1_http_operator_delete) | **DELETE** /api/v1/stable/operators/http/{v1-http-operator} | Delete an HTTP operator
|
|
142
|
-
*HatchetSdkRest::OperatorApi* | [**v1_http_operator_get**](docs/OperatorApi.md#v1_http_operator_get) | **GET** /api/v1/stable/operators/http/{v1-http-operator} | Get an HTTP operator
|
|
143
|
-
*HatchetSdkRest::OperatorApi* | [**v1_http_operator_list**](docs/OperatorApi.md#v1_http_operator_list) | **GET** /api/v1/stable/tenants/{tenant}/operators/http | List HTTP operators
|
|
144
|
-
*HatchetSdkRest::OperatorApi* | [**v1_http_operator_update**](docs/OperatorApi.md#v1_http_operator_update) | **PATCH** /api/v1/stable/operators/http/{v1-http-operator} | Update an HTTP operator
|
|
145
140
|
*HatchetSdkRest::RateLimitsApi* | [**rate_limit_delete**](docs/RateLimitsApi.md#rate_limit_delete) | **DELETE** /api/v1/tenants/{tenant}/rate-limits | Delete rate limit
|
|
146
141
|
*HatchetSdkRest::RateLimitsApi* | [**rate_limit_list**](docs/RateLimitsApi.md#rate_limit_list) | **GET** /api/v1/tenants/{tenant}/rate-limits | List rate limits
|
|
147
142
|
*HatchetSdkRest::SNSApi* | [**sns_create**](docs/SNSApi.md#sns_create) | **POST** /api/v1/tenants/{tenant}/sns | Create SNS integration
|
|
@@ -392,7 +387,6 @@ Class | Method | HTTP request | Description
|
|
|
392
387
|
- [HatchetSdkRest::V1CancelTaskRequest](docs/V1CancelTaskRequest.md)
|
|
393
388
|
- [HatchetSdkRest::V1CancelledTasks](docs/V1CancelledTasks.md)
|
|
394
389
|
- [HatchetSdkRest::V1CreateFilterRequest](docs/V1CreateFilterRequest.md)
|
|
395
|
-
- [HatchetSdkRest::V1CreateHTTPOperatorRequest](docs/V1CreateHTTPOperatorRequest.md)
|
|
396
390
|
- [HatchetSdkRest::V1CreateWebhookRequest](docs/V1CreateWebhookRequest.md)
|
|
397
391
|
- [HatchetSdkRest::V1CreateWebhookRequestAPIKey](docs/V1CreateWebhookRequestAPIKey.md)
|
|
398
392
|
- [HatchetSdkRest::V1CreateWebhookRequestBase](docs/V1CreateWebhookRequestBase.md)
|
|
@@ -409,8 +403,6 @@ Class | Method | HTTP request | Description
|
|
|
409
403
|
- [HatchetSdkRest::V1EventWorkflowRunSummary](docs/V1EventWorkflowRunSummary.md)
|
|
410
404
|
- [HatchetSdkRest::V1Filter](docs/V1Filter.md)
|
|
411
405
|
- [HatchetSdkRest::V1FilterList](docs/V1FilterList.md)
|
|
412
|
-
- [HatchetSdkRest::V1HTTPOperator](docs/V1HTTPOperator.md)
|
|
413
|
-
- [HatchetSdkRest::V1HTTPOperatorList](docs/V1HTTPOperatorList.md)
|
|
414
406
|
- [HatchetSdkRest::V1LogLine](docs/V1LogLine.md)
|
|
415
407
|
- [HatchetSdkRest::V1LogLineLevel](docs/V1LogLineLevel.md)
|
|
416
408
|
- [HatchetSdkRest::V1LogLineList](docs/V1LogLineList.md)
|
|
@@ -437,7 +429,6 @@ Class | Method | HTTP request | Description
|
|
|
437
429
|
- [HatchetSdkRest::V1TaskTimingList](docs/V1TaskTimingList.md)
|
|
438
430
|
- [HatchetSdkRest::V1TriggerWorkflowRunRequest](docs/V1TriggerWorkflowRunRequest.md)
|
|
439
431
|
- [HatchetSdkRest::V1UpdateFilterRequest](docs/V1UpdateFilterRequest.md)
|
|
440
|
-
- [HatchetSdkRest::V1UpdateHTTPOperatorRequest](docs/V1UpdateHTTPOperatorRequest.md)
|
|
441
432
|
- [HatchetSdkRest::V1UpdateWebhookRequest](docs/V1UpdateWebhookRequest.md)
|
|
442
433
|
- [HatchetSdkRest::V1WaitItem](docs/V1WaitItem.md)
|
|
443
434
|
- [HatchetSdkRest::V1Webhook](docs/V1Webhook.md)
|
|
@@ -41,6 +41,9 @@ module HatchetSdkRest
|
|
|
41
41
|
# Control-plane shard region for the tenant (e.g. aws:us-west-2).
|
|
42
42
|
attr_accessor :region
|
|
43
43
|
|
|
44
|
+
# The data retention period for the tenant, e.g. 720h.
|
|
45
|
+
attr_accessor :data_retention_period
|
|
46
|
+
|
|
44
47
|
class EnumAttributeValidator
|
|
45
48
|
attr_reader :datatype
|
|
46
49
|
attr_reader :allowable_values
|
|
@@ -74,7 +77,8 @@ module HatchetSdkRest
|
|
|
74
77
|
:'alert_member_emails' => :'alertMemberEmails',
|
|
75
78
|
:'environment' => :'environment',
|
|
76
79
|
:'server_url' => :'serverUrl',
|
|
77
|
-
:'region' => :'region'
|
|
80
|
+
:'region' => :'region',
|
|
81
|
+
:'data_retention_period' => :'dataRetentionPeriod'
|
|
78
82
|
}
|
|
79
83
|
end
|
|
80
84
|
|
|
@@ -99,7 +103,8 @@ module HatchetSdkRest
|
|
|
99
103
|
:'alert_member_emails' => :'Boolean',
|
|
100
104
|
:'environment' => :'TenantEnvironment',
|
|
101
105
|
:'server_url' => :'String',
|
|
102
|
-
:'region' => :'String'
|
|
106
|
+
:'region' => :'String',
|
|
107
|
+
:'data_retention_period' => :'String'
|
|
103
108
|
}
|
|
104
109
|
end
|
|
105
110
|
|
|
@@ -168,6 +173,10 @@ module HatchetSdkRest
|
|
|
168
173
|
if attributes.key?(:'region')
|
|
169
174
|
self.region = attributes[:'region']
|
|
170
175
|
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'data_retention_period')
|
|
178
|
+
self.data_retention_period = attributes[:'data_retention_period']
|
|
179
|
+
end
|
|
171
180
|
end
|
|
172
181
|
|
|
173
182
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -258,7 +267,8 @@ module HatchetSdkRest
|
|
|
258
267
|
alert_member_emails == o.alert_member_emails &&
|
|
259
268
|
environment == o.environment &&
|
|
260
269
|
server_url == o.server_url &&
|
|
261
|
-
region == o.region
|
|
270
|
+
region == o.region &&
|
|
271
|
+
data_retention_period == o.data_retention_period
|
|
262
272
|
end
|
|
263
273
|
|
|
264
274
|
# @see the `==` method
|
|
@@ -270,7 +280,7 @@ module HatchetSdkRest
|
|
|
270
280
|
# Calculates hash code according to all attributes.
|
|
271
281
|
# @return [Integer] Hash code
|
|
272
282
|
def hash
|
|
273
|
-
[metadata, name, slug, version, analytics_opt_out, alert_member_emails, environment, server_url, region].hash
|
|
283
|
+
[metadata, name, slug, version, analytics_opt_out, alert_member_emails, environment, server_url, region, data_retention_period].hash
|
|
274
284
|
end
|
|
275
285
|
|
|
276
286
|
# Builds the object from hash
|
|
@@ -161,7 +161,6 @@ HatchetSdkRest.autoload :V1CELDebugResponseStatus, 'hatchet-sdk-rest/models/v1_c
|
|
|
161
161
|
HatchetSdkRest.autoload :V1CancelTaskRequest, 'hatchet-sdk-rest/models/v1_cancel_task_request'
|
|
162
162
|
HatchetSdkRest.autoload :V1CancelledTasks, 'hatchet-sdk-rest/models/v1_cancelled_tasks'
|
|
163
163
|
HatchetSdkRest.autoload :V1CreateFilterRequest, 'hatchet-sdk-rest/models/v1_create_filter_request'
|
|
164
|
-
HatchetSdkRest.autoload :V1CreateHTTPOperatorRequest, 'hatchet-sdk-rest/models/v1_create_http_operator_request'
|
|
165
164
|
HatchetSdkRest.autoload :V1CreateWebhookRequest, 'hatchet-sdk-rest/models/v1_create_webhook_request'
|
|
166
165
|
HatchetSdkRest.autoload :V1CreateWebhookRequestAPIKey, 'hatchet-sdk-rest/models/v1_create_webhook_request_api_key'
|
|
167
166
|
HatchetSdkRest.autoload :V1CreateWebhookRequestBase, 'hatchet-sdk-rest/models/v1_create_webhook_request_base'
|
|
@@ -178,8 +177,6 @@ HatchetSdkRest.autoload :V1EventTriggeredRun, 'hatchet-sdk-rest/models/v1_event_
|
|
|
178
177
|
HatchetSdkRest.autoload :V1EventWorkflowRunSummary, 'hatchet-sdk-rest/models/v1_event_workflow_run_summary'
|
|
179
178
|
HatchetSdkRest.autoload :V1Filter, 'hatchet-sdk-rest/models/v1_filter'
|
|
180
179
|
HatchetSdkRest.autoload :V1FilterList, 'hatchet-sdk-rest/models/v1_filter_list'
|
|
181
|
-
HatchetSdkRest.autoload :V1HTTPOperator, 'hatchet-sdk-rest/models/v1_http_operator'
|
|
182
|
-
HatchetSdkRest.autoload :V1HTTPOperatorList, 'hatchet-sdk-rest/models/v1_http_operator_list'
|
|
183
180
|
HatchetSdkRest.autoload :V1LogLine, 'hatchet-sdk-rest/models/v1_log_line'
|
|
184
181
|
HatchetSdkRest.autoload :V1LogLineLevel, 'hatchet-sdk-rest/models/v1_log_line_level'
|
|
185
182
|
HatchetSdkRest.autoload :V1LogLineList, 'hatchet-sdk-rest/models/v1_log_line_list'
|
|
@@ -206,7 +203,6 @@ HatchetSdkRest.autoload :V1TaskTiming, 'hatchet-sdk-rest/models/v1_task_timing'
|
|
|
206
203
|
HatchetSdkRest.autoload :V1TaskTimingList, 'hatchet-sdk-rest/models/v1_task_timing_list'
|
|
207
204
|
HatchetSdkRest.autoload :V1TriggerWorkflowRunRequest, 'hatchet-sdk-rest/models/v1_trigger_workflow_run_request'
|
|
208
205
|
HatchetSdkRest.autoload :V1UpdateFilterRequest, 'hatchet-sdk-rest/models/v1_update_filter_request'
|
|
209
|
-
HatchetSdkRest.autoload :V1UpdateHTTPOperatorRequest, 'hatchet-sdk-rest/models/v1_update_http_operator_request'
|
|
210
206
|
HatchetSdkRest.autoload :V1UpdateWebhookRequest, 'hatchet-sdk-rest/models/v1_update_webhook_request'
|
|
211
207
|
HatchetSdkRest.autoload :V1WaitItem, 'hatchet-sdk-rest/models/v1_wait_item'
|
|
212
208
|
HatchetSdkRest.autoload :V1Webhook, 'hatchet-sdk-rest/models/v1_webhook'
|
|
@@ -280,7 +276,6 @@ HatchetSdkRest.autoload :HealthcheckApi, 'hatchet-sdk-rest/api/healthcheck_api'
|
|
|
280
276
|
HatchetSdkRest.autoload :LogApi, 'hatchet-sdk-rest/api/log_api'
|
|
281
277
|
HatchetSdkRest.autoload :MetadataApi, 'hatchet-sdk-rest/api/metadata_api'
|
|
282
278
|
HatchetSdkRest.autoload :ObservabilityApi, 'hatchet-sdk-rest/api/observability_api'
|
|
283
|
-
HatchetSdkRest.autoload :OperatorApi, 'hatchet-sdk-rest/api/operator_api'
|
|
284
279
|
HatchetSdkRest.autoload :RateLimitsApi, 'hatchet-sdk-rest/api/rate_limits_api'
|
|
285
280
|
HatchetSdkRest.autoload :SNSApi, 'hatchet-sdk-rest/api/sns_api'
|
|
286
281
|
HatchetSdkRest.autoload :SlackApi, 'hatchet-sdk-rest/api/slack_api'
|
|
@@ -7,7 +7,7 @@ require 'google/protobuf'
|
|
|
7
7
|
require 'google/protobuf/timestamp_pb'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
descriptor_data = "\n\x1b\x64ispatcher/dispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Z\n\x0cWorkerLabels\x12\x16\n\tstr_value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tint_value\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0c\n\n_str_valueB\x0c\n\n_int_value\"\xcc\x01\n\x0bRuntimeInfo\x12\x18\n\x0bsdk_version\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x08language\x18\x02 \x01(\x0e\x32\x05.SDKSH\x01\x88\x01\x01\x12\x1d\n\x10language_version\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x0f\n\x02os\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x12\n\x05\x65xtra\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\x0e\n\x0c_sdk_versionB\x0b\n\t_languageB\x13\n\x11_language_versionB\x05\n\x03_osB\x08\n\x06_extra\"\xb1\x03\n\x15WorkerRegisterRequest\x12\x13\n\x0bworker_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x12\n\x05slots\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x17\n\nwebhook_id\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\'\n\x0cruntime_info\x18\x07 \x01(\x0b\x32\x0c.RuntimeInfoH\x02\x88\x01\x01\x12;\n\x0bslot_config\x18\t \x03(\x0b\x32&.WorkerRegisterRequest.SlotConfigEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\x1a\x31\n\x0fSlotConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x42\x08\n\x06_slotsB\r\n\x0b_webhook_idB\x0f\n\r_runtime_info\"S\n\x16WorkerRegisterResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12\x13\n\x0bworker_name\x18\x03 \x01(\t\"\xa4\x01\n\x19UpsertWorkerLabelsRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.UpsertWorkerLabelsRequest.LabelsEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\"B\n\x1aUpsertWorkerLabelsResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xcc\x08\n\x0e\x41ssignedAction\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x0e\n\x06job_id\x18\x04 \x01(\t\x12\x10\n\x08job_name\x18\x05 \x01(\t\x12\x12\n\njob_run_id\x18\x06 \x01(\t\x12\x0f\n\x07task_id\x18\x07 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x08 \x01(\t\x12\x11\n\taction_id\x18\t \x01(\t\x12 \n\x0b\x61\x63tion_type\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x16\n\x0e\x61\x63tion_payload\x18\x0b \x01(\t\x12\x11\n\ttask_name\x18\x0c \x01(\t\x12\x13\n\x0bretry_count\x18\r \x01(\x05\x12 \n\x13\x61\x64\x64itional_metadata\x18\x0e \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63hild_workflow_index\x18\x0f \x01(\x05H\x01\x88\x01\x01\x12\x1f\n\x12\x63hild_workflow_key\x18\x10 \x01(\tH\x02\x88\x01\x01\x12#\n\x16parent_workflow_run_id\x18\x11 \x01(\tH\x03\x88\x01\x01\x12\x10\n\x08priority\x18\x12 \x01(\x05\x12\x18\n\x0bworkflow_id\x18\x13 \x01(\tH\x04\x88\x01\x01\x12 \n\x13workflow_version_id\x18\x14 \x01(\tH\x05\x88\x01\x01\x12*\n\x1d\x64urable_task_invocation_count\x18\x15 \x01(\x05H\x06\x88\x01\x01\x12)\n\x1ctriggering_event_external_id\x18\x16 \x01(\tH\x07\x88\x01\x01\x12!\n\x14triggering_event_key\x18\x17 \x01(\tH\x08\x88\x01\x01\x12\x14\n\x07\x62\x61tchId\x18\x18 \x01(\tH\t\x88\x01\x01\x12\x16\n\tbatchSize\x18\x19 \x01(\x05H\n\x88\x01\x01\x12\x17\n\nbatchIndex\x18\x1a \x01(\x05H\x0b\x88\x01\x01\x12\x32\n\x11\x62\x61tchStartPayload\x18\x1b \x01(\x0b\x32\x12.BatchStartPayloadH\x0c\x88\x01\x01\x12\x15\n\x08\x62\x61tchKey\x18\x1c \x01(\tH\r\x88\x01\x01\x42\x16\n\x14_additional_metadataB\x17\n\x15_child_workflow_indexB\x15\n\x13_child_workflow_keyB\x19\n\x17_parent_workflow_run_idB\x0e\n\x0c_workflow_idB\x16\n\x14_workflow_version_idB \n\x1e_durable_task_invocation_countB\x1f\n\x1d_triggering_event_external_idB\x17\n\x15_triggering_event_keyB\n\n\x08_batchIdB\x0c\n\n_batchSizeB\r\n\x0b_batchIndexB\x14\n\x12_batchStartPayloadB\x0b\n\t_batchKey\"q\n\x11\x42\x61tchStartPayload\x12\x15\n\rtriggerReason\x18\x01 \x01(\t\x12/\n\x0btriggerTime\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65xpectedSize\x18\x03 \x01(\x05\"(\n\x13WorkerListenRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"-\n\x18WorkerUnsubscribeRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"A\n\x19WorkerUnsubscribeResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xec\x01\n\x13GroupKeyActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x11\n\taction_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\nevent_type\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x15\n\revent_payload\x18\x07 \x01(\t\"\xde\x02\n\x0fStepActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x12\n\njob_run_id\x18\x03 \x01(\t\x12\x0f\n\x07task_id\x18\x04 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x05 \x01(\t\x12\x11\n\taction_id\x18\x06 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\nevent_type\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x15\n\revent_payload\x18\t \x01(\t\x12\x18\n\x0bretry_count\x18\n \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10should_not_retry\x18\x0b \x01(\x08H\x01\x88\x01\x01\x42\x0e\n\x0c_retry_countB\x13\n\x11_should_not_retry\"\xa9\x01\n\x14\x42\x61tchActionEventItem\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x15\n\revent_payload\x18\x02 \x01(\t\x12\x18\n\x0bretry_count\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10should_not_retry\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x0e\n\x0c_retry_countB\x13\n\x11_should_not_retry\"\xf1\x01\n\x10\x42\x61tchActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x11\n\taction_id\x18\x03 \x01(\t\x12\x15\n\x08\x62\x61tch_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\nevent_type\x18\x06 \x01(\x0e\x32\x14.StepActionEventType\x12$\n\x05items\x18\x07 \x03(\x0b\x32\x15.BatchActionEventItemB\x0b\n\t_batch_id\";\n\x13\x41\x63tionEventResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xcc\x01\n SubscribeToWorkflowEventsRequest\x12\x1c\n\x0fworkflow_run_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_meta_key\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\"\n\x15\x61\x64\x64itional_meta_value\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x12\n\x10_workflow_run_idB\x16\n\x14_additional_meta_keyB\x18\n\x16_additional_meta_value\"9\n\x1eSubscribeToWorkflowRunsRequest\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"\xe7\x02\n\rWorkflowEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12$\n\rresource_type\x18\x02 \x01(\x0e\x32\r.ResourceType\x12&\n\nevent_type\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x13\n\x0bresource_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\revent_payload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x19\n\x0ctask_retries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x18\n\x0bretry_count\x18\t \x01(\x05H\x01\x88\x01\x01\x12\x18\n\x0b\x65vent_index\x18\n \x01(\x03H\x02\x88\x01\x01\x42\x0f\n\r_task_retriesB\x0e\n\x0c_retry_countB\x0e\n\x0c_event_index\"\xac\x01\n\x10WorkflowRunEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12)\n\nevent_type\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x33\n\x0f\x65vent_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x92\x01\n\rStepRunResult\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x11\n\ttask_name\x18\x02 \x01(\t\x12\x12\n\njob_run_id\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x05 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_errorB\t\n\x07_output\"c\n\rOverridesData\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x17\n\x0f\x63\x61ller_filename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"W\n\x10HeartbeatRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x30\n\x0cheartbeat_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"S\n\x15RefreshTimeoutRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x1c\n\x14increment_timeout_by\x18\x02 \x01(\t\"H\n\x16RefreshTimeoutResponse\x12.\n\ntimeout_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"2\n\x12ReleaseSlotRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse\"9\n\x19RestoreEvictedTaskRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\".\n\x1aRestoreEvictedTaskResponse\x12\x10\n\x08requeued\x18\x01 \x01(\x08\"\x13\n\x11GetVersionRequest\"%\n\x12GetVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t*A\n\x04SDKS\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x06\n\x02GO\x10\x01\x12\n\n\x06PYTHON\x10\x02\x12\x0e\n\nTYPESCRIPT\x10\x03\x12\x08\n\x04RUBY\x10\x04*_\n\nActionType\x12\x12\n\x0eSTART_STEP_RUN\x10\x00\x12\x13\n\x0f\x43\x41NCEL_STEP_RUN\x10\x01\x12\x17\n\x13START_GET_GROUP_KEY\x10\x02\x12\x0f\n\x0bSTART_BATCH\x10\x03*\xa2\x01\n\x17GroupKeyActionEventType\x12 \n\x1cGROUP_KEY_EVENT_TYPE_UNKNOWN\x10\x00\x12 \n\x1cGROUP_KEY_EVENT_TYPE_STARTED\x10\x01\x12\"\n\x1eGROUP_KEY_EVENT_TYPE_COMPLETED\x10\x02\x12\x1f\n\x1bGROUP_KEY_EVENT_TYPE_FAILED\x10\x03*\xcb\x01\n\x13StepActionEventType\x12\x1b\n\x17STEP_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1b\n\x17STEP_EVENT_TYPE_STARTED\x10\x01\x12\x1d\n\x19STEP_EVENT_TYPE_COMPLETED\x10\x02\x12\x1a\n\x16STEP_EVENT_TYPE_FAILED\x10\x03\x12 \n\x1cSTEP_EVENT_TYPE_ACKNOWLEDGED\x10\x04\x12\x1d\n\x19STEP_EVENT_TYPE_CANCELLED\x10\x05*e\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\x1a\n\x16RESOURCE_TYPE_STEP_RUN\x10\x01\x12\x1e\n\x1aRESOURCE_TYPE_WORKFLOW_RUN\x10\x02*\xfe\x01\n\x11ResourceEventType\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_STARTED\x10\x01\x12!\n\x1dRESOURCE_EVENT_TYPE_COMPLETED\x10\x02\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_FAILED\x10\x03\x12!\n\x1dRESOURCE_EVENT_TYPE_CANCELLED\x10\x04\x12!\n\x1dRESOURCE_EVENT_TYPE_TIMED_OUT\x10\x05\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_STREAM\x10\x06*<\n\x14WorkflowRunEventType\x12$\n WORKFLOW_RUN_EVENT_TYPE_FINISHED\x10\x00\x32\xc5\x08\n\nDispatcher\x12=\n\x08Register\x12\x16.WorkerRegisterRequest\x1a\x17.WorkerRegisterResponse\"\x00\x12\x33\n\x06Listen\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x35\n\x08ListenV2\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x34\n\tHeartbeat\x12\x11.HeartbeatRequest\x1a\x12.HeartbeatResponse\"\x00\x12R\n\x19SubscribeToWorkflowEvents\x12!.SubscribeToWorkflowEventsRequest\x1a\x0e.WorkflowEvent\"\x00\x30\x01\x12S\n\x17SubscribeToWorkflowRuns\x12\x1f.SubscribeToWorkflowRunsRequest\x1a\x11.WorkflowRunEvent\"\x00(\x01\x30\x01\x12?\n\x13SendStepActionEvent\x12\x10.StepActionEvent\x1a\x14.ActionEventResponse\"\x00\x12\x41\n\x14SendBatchActionEvent\x12\x11.BatchActionEvent\x1a\x14.ActionEventResponse\"\x00\x12G\n\x17SendGroupKeyActionEvent\x12\x14.GroupKeyActionEvent\x1a\x14.ActionEventResponse\"\x00\x12<\n\x10PutOverridesData\x12\x0e.OverridesData\x1a\x16.OverridesDataResponse\"\x00\x12\x46\n\x0bUnsubscribe\x12\x19.WorkerUnsubscribeRequest\x1a\x1a.WorkerUnsubscribeResponse\"\x00\x12\x43\n\x0eRefreshTimeout\x12\x16.RefreshTimeoutRequest\x1a\x17.RefreshTimeoutResponse\"\x00\x12:\n\x0bReleaseSlot\x12\x13.ReleaseSlotRequest\x1a\x14.ReleaseSlotResponse\"\x00\x12O\n\x12RestoreEvictedTask\x12\x1a.RestoreEvictedTaskRequest\x1a\x1b.RestoreEvictedTaskResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x12\x37\n\nGetVersion\x12\x12.GetVersionRequest\x1a\x13.GetVersionResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3"
|
|
10
|
+
descriptor_data = "\n\x1b\x64ispatcher/dispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Z\n\x0cWorkerLabels\x12\x16\n\tstr_value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tint_value\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0c\n\n_str_valueB\x0c\n\n_int_value\"\xcc\x01\n\x0bRuntimeInfo\x12\x18\n\x0bsdk_version\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x08language\x18\x02 \x01(\x0e\x32\x05.SDKSH\x01\x88\x01\x01\x12\x1d\n\x10language_version\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x0f\n\x02os\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x12\n\x05\x65xtra\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\x0e\n\x0c_sdk_versionB\x0b\n\t_languageB\x13\n\x11_language_versionB\x05\n\x03_osB\x08\n\x06_extra\"\xb1\x03\n\x15WorkerRegisterRequest\x12\x13\n\x0bworker_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x12\n\x05slots\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x17\n\nwebhook_id\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\'\n\x0cruntime_info\x18\x07 \x01(\x0b\x32\x0c.RuntimeInfoH\x02\x88\x01\x01\x12;\n\x0bslot_config\x18\t \x03(\x0b\x32&.WorkerRegisterRequest.SlotConfigEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\x1a\x31\n\x0fSlotConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x42\x08\n\x06_slotsB\r\n\x0b_webhook_idB\x0f\n\r_runtime_info\"S\n\x16WorkerRegisterResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\x12\x13\n\x0bworker_name\x18\x03 \x01(\t\"\xa4\x01\n\x19UpsertWorkerLabelsRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.UpsertWorkerLabelsRequest.LabelsEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\"B\n\x1aUpsertWorkerLabelsResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\x9c\t\n\x0e\x41ssignedAction\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x0e\n\x06job_id\x18\x04 \x01(\t\x12\x10\n\x08job_name\x18\x05 \x01(\t\x12\x12\n\njob_run_id\x18\x06 \x01(\t\x12\x0f\n\x07task_id\x18\x07 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x08 \x01(\t\x12\x11\n\taction_id\x18\t \x01(\t\x12 \n\x0b\x61\x63tion_type\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x16\n\x0e\x61\x63tion_payload\x18\x0b \x01(\t\x12\x11\n\ttask_name\x18\x0c \x01(\t\x12\x13\n\x0bretry_count\x18\r \x01(\x05\x12 \n\x13\x61\x64\x64itional_metadata\x18\x0e \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63hild_workflow_index\x18\x0f \x01(\x05H\x01\x88\x01\x01\x12\x1f\n\x12\x63hild_workflow_key\x18\x10 \x01(\tH\x02\x88\x01\x01\x12#\n\x16parent_workflow_run_id\x18\x11 \x01(\tH\x03\x88\x01\x01\x12\x10\n\x08priority\x18\x12 \x01(\x05\x12\x18\n\x0bworkflow_id\x18\x13 \x01(\tH\x04\x88\x01\x01\x12 \n\x13workflow_version_id\x18\x14 \x01(\tH\x05\x88\x01\x01\x12*\n\x1d\x64urable_task_invocation_count\x18\x15 \x01(\x05H\x06\x88\x01\x01\x12)\n\x1ctriggering_event_external_id\x18\x16 \x01(\tH\x07\x88\x01\x01\x12!\n\x14triggering_event_key\x18\x17 \x01(\tH\x08\x88\x01\x01\x12\x14\n\x07\x62\x61tchId\x18\x18 \x01(\tH\t\x88\x01\x01\x12\x16\n\tbatchSize\x18\x19 \x01(\x05H\n\x88\x01\x01\x12\x17\n\nbatchIndex\x18\x1a \x01(\x05H\x0b\x88\x01\x01\x12\x32\n\x11\x62\x61tchStartPayload\x18\x1b \x01(\x0b\x32\x12.BatchStartPayloadH\x0c\x88\x01\x01\x12\x15\n\x08\x62\x61tchKey\x18\x1c \x01(\tH\r\x88\x01\x01\x12\x39\n\x10task_inserted_at\x18\x1d \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x0e\x88\x01\x01\x42\x16\n\x14_additional_metadataB\x17\n\x15_child_workflow_indexB\x15\n\x13_child_workflow_keyB\x19\n\x17_parent_workflow_run_idB\x0e\n\x0c_workflow_idB\x16\n\x14_workflow_version_idB \n\x1e_durable_task_invocation_countB\x1f\n\x1d_triggering_event_external_idB\x17\n\x15_triggering_event_keyB\n\n\x08_batchIdB\x0c\n\n_batchSizeB\r\n\x0b_batchIndexB\x14\n\x12_batchStartPayloadB\x0b\n\t_batchKeyB\x13\n\x11_task_inserted_at\"q\n\x11\x42\x61tchStartPayload\x12\x15\n\rtriggerReason\x18\x01 \x01(\t\x12/\n\x0btriggerTime\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65xpectedSize\x18\x03 \x01(\x05\"(\n\x13WorkerListenRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"-\n\x18WorkerUnsubscribeRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\"A\n\x19WorkerUnsubscribeResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xec\x01\n\x13GroupKeyActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x17\n\x0fworkflow_run_id\x18\x02 \x01(\t\x12\x1c\n\x14get_group_key_run_id\x18\x03 \x01(\t\x12\x11\n\taction_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\nevent_type\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x15\n\revent_payload\x18\x07 \x01(\t\"\xde\x02\n\x0fStepActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x12\n\njob_run_id\x18\x03 \x01(\t\x12\x0f\n\x07task_id\x18\x04 \x01(\t\x12\x1c\n\x14task_run_external_id\x18\x05 \x01(\t\x12\x11\n\taction_id\x18\x06 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\nevent_type\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x15\n\revent_payload\x18\t \x01(\t\x12\x18\n\x0bretry_count\x18\n \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10should_not_retry\x18\x0b \x01(\x08H\x01\x88\x01\x01\x42\x0e\n\x0c_retry_countB\x13\n\x11_should_not_retry\"\xa9\x01\n\x14\x42\x61tchActionEventItem\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x15\n\revent_payload\x18\x02 \x01(\t\x12\x18\n\x0bretry_count\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10should_not_retry\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x0e\n\x0c_retry_countB\x13\n\x11_should_not_retry\"\xf1\x01\n\x10\x42\x61tchActionEvent\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x11\n\taction_id\x18\x03 \x01(\t\x12\x15\n\x08\x62\x61tch_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\nevent_type\x18\x06 \x01(\x0e\x32\x14.StepActionEventType\x12$\n\x05items\x18\x07 \x03(\x0b\x32\x15.BatchActionEventItemB\x0b\n\t_batch_id\";\n\x13\x41\x63tionEventResponse\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tworker_id\x18\x02 \x01(\t\"\xcc\x01\n SubscribeToWorkflowEventsRequest\x12\x1c\n\x0fworkflow_run_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_meta_key\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\"\n\x15\x61\x64\x64itional_meta_value\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x12\n\x10_workflow_run_idB\x16\n\x14_additional_meta_keyB\x18\n\x16_additional_meta_value\"9\n\x1eSubscribeToWorkflowRunsRequest\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"\xe7\x02\n\rWorkflowEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12$\n\rresource_type\x18\x02 \x01(\x0e\x32\r.ResourceType\x12&\n\nevent_type\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x13\n\x0bresource_id\x18\x04 \x01(\t\x12\x33\n\x0f\x65vent_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\revent_payload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x19\n\x0ctask_retries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x18\n\x0bretry_count\x18\t \x01(\x05H\x01\x88\x01\x01\x12\x18\n\x0b\x65vent_index\x18\n \x01(\x03H\x02\x88\x01\x01\x42\x0f\n\r_task_retriesB\x0e\n\x0c_retry_countB\x0e\n\x0c_event_index\"\xac\x01\n\x10WorkflowRunEvent\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\x12)\n\nevent_type\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x33\n\x0f\x65vent_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x92\x01\n\rStepRunResult\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x11\n\ttask_name\x18\x02 \x01(\t\x12\x12\n\njob_run_id\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x05 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_errorB\t\n\x07_output\"c\n\rOverridesData\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x17\n\x0f\x63\x61ller_filename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"W\n\x10HeartbeatRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x30\n\x0cheartbeat_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"S\n\x15RefreshTimeoutRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\x12\x1c\n\x14increment_timeout_by\x18\x02 \x01(\t\"H\n\x16RefreshTimeoutResponse\x12.\n\ntimeout_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"2\n\x12ReleaseSlotRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse\"9\n\x19RestoreEvictedTaskRequest\x12\x1c\n\x14task_run_external_id\x18\x01 \x01(\t\".\n\x1aRestoreEvictedTaskResponse\x12\x10\n\x08requeued\x18\x01 \x01(\x08\"\x13\n\x11GetVersionRequest\"%\n\x12GetVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t*A\n\x04SDKS\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x06\n\x02GO\x10\x01\x12\n\n\x06PYTHON\x10\x02\x12\x0e\n\nTYPESCRIPT\x10\x03\x12\x08\n\x04RUBY\x10\x04*_\n\nActionType\x12\x12\n\x0eSTART_STEP_RUN\x10\x00\x12\x13\n\x0f\x43\x41NCEL_STEP_RUN\x10\x01\x12\x17\n\x13START_GET_GROUP_KEY\x10\x02\x12\x0f\n\x0bSTART_BATCH\x10\x03*\xa2\x01\n\x17GroupKeyActionEventType\x12 \n\x1cGROUP_KEY_EVENT_TYPE_UNKNOWN\x10\x00\x12 \n\x1cGROUP_KEY_EVENT_TYPE_STARTED\x10\x01\x12\"\n\x1eGROUP_KEY_EVENT_TYPE_COMPLETED\x10\x02\x12\x1f\n\x1bGROUP_KEY_EVENT_TYPE_FAILED\x10\x03*\xcb\x01\n\x13StepActionEventType\x12\x1b\n\x17STEP_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1b\n\x17STEP_EVENT_TYPE_STARTED\x10\x01\x12\x1d\n\x19STEP_EVENT_TYPE_COMPLETED\x10\x02\x12\x1a\n\x16STEP_EVENT_TYPE_FAILED\x10\x03\x12 \n\x1cSTEP_EVENT_TYPE_ACKNOWLEDGED\x10\x04\x12\x1d\n\x19STEP_EVENT_TYPE_CANCELLED\x10\x05*e\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\x1a\n\x16RESOURCE_TYPE_STEP_RUN\x10\x01\x12\x1e\n\x1aRESOURCE_TYPE_WORKFLOW_RUN\x10\x02*\xfe\x01\n\x11ResourceEventType\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_STARTED\x10\x01\x12!\n\x1dRESOURCE_EVENT_TYPE_COMPLETED\x10\x02\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_FAILED\x10\x03\x12!\n\x1dRESOURCE_EVENT_TYPE_CANCELLED\x10\x04\x12!\n\x1dRESOURCE_EVENT_TYPE_TIMED_OUT\x10\x05\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_STREAM\x10\x06*<\n\x14WorkflowRunEventType\x12$\n WORKFLOW_RUN_EVENT_TYPE_FINISHED\x10\x00\x32\xc5\x08\n\nDispatcher\x12=\n\x08Register\x12\x16.WorkerRegisterRequest\x1a\x17.WorkerRegisterResponse\"\x00\x12\x33\n\x06Listen\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x35\n\x08ListenV2\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x34\n\tHeartbeat\x12\x11.HeartbeatRequest\x1a\x12.HeartbeatResponse\"\x00\x12R\n\x19SubscribeToWorkflowEvents\x12!.SubscribeToWorkflowEventsRequest\x1a\x0e.WorkflowEvent\"\x00\x30\x01\x12S\n\x17SubscribeToWorkflowRuns\x12\x1f.SubscribeToWorkflowRunsRequest\x1a\x11.WorkflowRunEvent\"\x00(\x01\x30\x01\x12?\n\x13SendStepActionEvent\x12\x10.StepActionEvent\x1a\x14.ActionEventResponse\"\x00\x12\x41\n\x14SendBatchActionEvent\x12\x11.BatchActionEvent\x1a\x14.ActionEventResponse\"\x00\x12G\n\x17SendGroupKeyActionEvent\x12\x14.GroupKeyActionEvent\x1a\x14.ActionEventResponse\"\x00\x12<\n\x10PutOverridesData\x12\x0e.OverridesData\x1a\x16.OverridesDataResponse\"\x00\x12\x46\n\x0bUnsubscribe\x12\x19.WorkerUnsubscribeRequest\x1a\x1a.WorkerUnsubscribeResponse\"\x00\x12\x43\n\x0eRefreshTimeout\x12\x16.RefreshTimeoutRequest\x1a\x17.RefreshTimeoutResponse\"\x00\x12:\n\x0bReleaseSlot\x12\x13.ReleaseSlotRequest\x1a\x14.ReleaseSlotResponse\"\x00\x12O\n\x12RestoreEvictedTask\x12\x1a.RestoreEvictedTaskRequest\x1a\x1b.RestoreEvictedTaskResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x12\x37\n\nGetVersion\x12\x12.GetVersionRequest\x1a\x13.GetVersionResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3"
|
|
11
11
|
|
|
12
12
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -82,6 +82,51 @@ module Hatchet
|
|
|
82
82
|
def delete(workflow_id)
|
|
83
83
|
@workflow_api.workflow_delete(workflow_id)
|
|
84
84
|
end
|
|
85
|
+
|
|
86
|
+
# Pause a workflow. While paused, new runs of the workflow are queued but not started.
|
|
87
|
+
#
|
|
88
|
+
# @param workflow_id [String] The ID of the workflow to pause
|
|
89
|
+
# @param queue_ttl [Integer, String] How long runs stay queued while the workflow is paused before they are dropped, in seconds or as a duration string (e.g. "1h30m")
|
|
90
|
+
# @param paused_workflow_cron_run_queue_behavior [String] The behavior of cron runs triggered while the workflow is paused ("QUEUE" or "DROP")
|
|
91
|
+
# @param paused_workflow_scheduled_run_queue_behavior [String] The behavior of scheduled runs triggered while the workflow is paused ("QUEUE" or "DROP")
|
|
92
|
+
# @return [HatchetSdkRest::Workflow] The updated workflow
|
|
93
|
+
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
94
|
+
# @example
|
|
95
|
+
# hatchet.workflows.pause("workflow-123", queue_ttl: 3600)
|
|
96
|
+
def pause(
|
|
97
|
+
workflow_id,
|
|
98
|
+
queue_ttl:,
|
|
99
|
+
paused_workflow_cron_run_queue_behavior: HatchetSdkRest::WorkflowPauseScheduledCronRunQueueBehavior::QUEUE,
|
|
100
|
+
paused_workflow_scheduled_run_queue_behavior: HatchetSdkRest::WorkflowPauseScheduledCronRunQueueBehavior::QUEUE
|
|
101
|
+
)
|
|
102
|
+
pause_request = HatchetSdkRest::PauseWorkflowRequestPause.new(
|
|
103
|
+
action: "pause",
|
|
104
|
+
paused_workflow_queue_ttl: queue_ttl.is_a?(String) ? queue_ttl : "#{queue_ttl}s",
|
|
105
|
+
paused_workflow_cron_run_queue_behavior: paused_workflow_cron_run_queue_behavior,
|
|
106
|
+
paused_workflow_scheduled_run_queue_behavior: paused_workflow_scheduled_run_queue_behavior,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
@workflow_api.workflow_update(
|
|
110
|
+
workflow_id,
|
|
111
|
+
HatchetSdkRest::WorkflowUpdateRequest.new(pause: pause_request),
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Unpause a workflow
|
|
116
|
+
#
|
|
117
|
+
# @param workflow_id [String] The ID of the workflow to unpause
|
|
118
|
+
# @return [HatchetSdkRest::Workflow] The updated workflow
|
|
119
|
+
# @raise [HatchetSdkRest::ApiError] If the API request fails
|
|
120
|
+
# @example
|
|
121
|
+
# hatchet.workflows.unpause("workflow-123")
|
|
122
|
+
def unpause(workflow_id)
|
|
123
|
+
@workflow_api.workflow_update(
|
|
124
|
+
workflow_id,
|
|
125
|
+
HatchetSdkRest::WorkflowUpdateRequest.new(
|
|
126
|
+
pause: HatchetSdkRest::PauseWorkflowRequestUnpause.new(action: "unpause"),
|
|
127
|
+
),
|
|
128
|
+
)
|
|
129
|
+
end
|
|
85
130
|
end
|
|
86
131
|
end
|
|
87
132
|
end
|
data/lib/hatchet/version.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
4
|
require "monitor"
|
|
5
|
+
require "set"
|
|
5
6
|
require "timeout"
|
|
6
7
|
|
|
7
8
|
module Hatchet
|
|
@@ -23,6 +24,9 @@ module Hatchet
|
|
|
23
24
|
DEFAULT_RECONNECT_INTERVAL = 3 # seconds
|
|
24
25
|
EVICTION_ACK_TIMEOUT_SECONDS = 30.0
|
|
25
26
|
REGISTER_WORKER_ACK_TIMEOUT_SECONDS = 10.0
|
|
27
|
+
WORKER_STATUS_RESEND_INTERVAL_SECONDS = 5.0
|
|
28
|
+
WORKER_STATUS_RESEND_MIN_PENDING_SECONDS = 2.0
|
|
29
|
+
WORKER_STATUS_MAX_ENTRIES_PER_REQUEST = 10_000
|
|
26
30
|
|
|
27
31
|
# Outgoing event sent via ``send_event``.
|
|
28
32
|
#
|
|
@@ -61,6 +65,10 @@ module Hatchet
|
|
|
61
65
|
@pending_eviction_acks = {}
|
|
62
66
|
# (task_external_id, invocation_count, branch_id, node_id) => Queue
|
|
63
67
|
@pending_callbacks = {}
|
|
68
|
+
# pending callback keys registered since the last worker status request
|
|
69
|
+
@newly_waiting_keys = Set.new
|
|
70
|
+
# pending callback key => monotonic time it was registered at
|
|
71
|
+
@waiting_since = {}
|
|
64
72
|
# key -> [inserted_at, result] (rudimentary TTL cache)
|
|
65
73
|
@buffered_completions = {}
|
|
66
74
|
|
|
@@ -158,6 +166,7 @@ module Hatchet
|
|
|
158
166
|
end
|
|
159
167
|
|
|
160
168
|
queue = @mu.synchronize do
|
|
169
|
+
register_waiting_key(key)
|
|
161
170
|
@pending_callbacks[key] ||= Queue.new
|
|
162
171
|
end
|
|
163
172
|
|
|
@@ -166,7 +175,7 @@ module Hatchet
|
|
|
166
175
|
"task=#{durable_task_external_id} invocation=#{invocation_count} " \
|
|
167
176
|
"branch_id=#{branch_id} node_id=#{node_id}",
|
|
168
177
|
)
|
|
169
|
-
|
|
178
|
+
enqueue_worker_status_for_newly_waiting_keys
|
|
170
179
|
|
|
171
180
|
result = await_queue(queue)
|
|
172
181
|
@logger&.debug(
|
|
@@ -355,7 +364,7 @@ module Hatchet
|
|
|
355
364
|
@stream = stub.durable_task(@request_enum, metadata: @config.auth_metadata)
|
|
356
365
|
|
|
357
366
|
register_worker
|
|
358
|
-
|
|
367
|
+
enqueue_full_worker_status
|
|
359
368
|
|
|
360
369
|
@logger&.info("durable event listener connected")
|
|
361
370
|
end
|
|
@@ -436,34 +445,76 @@ module Hatchet
|
|
|
436
445
|
)
|
|
437
446
|
end
|
|
438
447
|
|
|
439
|
-
def
|
|
440
|
-
|
|
448
|
+
def register_waiting_key(key)
|
|
449
|
+
@waiting_since[key] = monotonic_now
|
|
450
|
+
@newly_waiting_keys.add(key)
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# Waiters that register at the same time share one request: whichever
|
|
454
|
+
# thread gets here first reports all of them, and the rest find nothing
|
|
455
|
+
# left to report.
|
|
456
|
+
def enqueue_worker_status_for_newly_waiting_keys
|
|
457
|
+
keys = @mu.synchronize do
|
|
458
|
+
newly_waiting = @newly_waiting_keys.select { |key| @pending_callbacks.key?(key) }
|
|
459
|
+
@newly_waiting_keys.clear
|
|
460
|
+
newly_waiting
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
enqueue_worker_status_for(keys)
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
def enqueue_worker_status_for_long_pending_waiters
|
|
467
|
+
registered_before = monotonic_now - WORKER_STATUS_RESEND_MIN_PENDING_SECONDS
|
|
468
|
+
|
|
469
|
+
keys = @mu.synchronize do
|
|
470
|
+
@waiting_since.select! { |key, _| @pending_callbacks.key?(key) }
|
|
471
|
+
@waiting_since.select { |_, waiting_since| waiting_since <= registered_before }.keys
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
enqueue_worker_status_for(keys)
|
|
475
|
+
end
|
|
441
476
|
|
|
442
|
-
|
|
443
|
-
|
|
477
|
+
def enqueue_full_worker_status
|
|
478
|
+
keys = @mu.synchronize do
|
|
479
|
+
@newly_waiting_keys.clear
|
|
480
|
+
@pending_callbacks.keys
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
enqueue_worker_status_for(keys)
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
def enqueue_worker_status_for(keys)
|
|
487
|
+
request_queue = @request_queue
|
|
488
|
+
return if request_queue.nil? || @worker_id.nil?
|
|
489
|
+
|
|
490
|
+
keys.each_slice(WORKER_STATUS_MAX_ENTRIES_PER_REQUEST) do |keys_for_request|
|
|
491
|
+
waiting = keys_for_request.map do |(task_ext_id, inv_count, branch_id, node_id)|
|
|
492
|
+
::V1::DurableTaskAwaitedCompletedEntry.new(
|
|
493
|
+
durable_task_external_id: task_ext_id,
|
|
494
|
+
invocation_count: inv_count,
|
|
495
|
+
node_id: node_id,
|
|
496
|
+
branch_id: branch_id,
|
|
497
|
+
)
|
|
498
|
+
end
|
|
444
499
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
branch_id: branch_id,
|
|
500
|
+
request_queue << ::V1::DurableTaskRequest.new(
|
|
501
|
+
worker_status: ::V1::DurableTaskWorkerStatusRequest.new(
|
|
502
|
+
worker_id: @worker_id,
|
|
503
|
+
waiting_entries: waiting,
|
|
504
|
+
),
|
|
451
505
|
)
|
|
452
506
|
end
|
|
507
|
+
end
|
|
453
508
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
worker_id: @worker_id,
|
|
457
|
-
waiting_entries: waiting,
|
|
458
|
-
),
|
|
459
|
-
)
|
|
509
|
+
def monotonic_now
|
|
510
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
460
511
|
end
|
|
461
512
|
|
|
462
513
|
def send_loop
|
|
463
514
|
while @running
|
|
464
|
-
sleep
|
|
515
|
+
sleep WORKER_STATUS_RESEND_INTERVAL_SECONDS
|
|
465
516
|
begin
|
|
466
|
-
|
|
517
|
+
enqueue_worker_status_for_long_pending_waiters
|
|
467
518
|
rescue StandardError => e
|
|
468
519
|
@logger&.error("durable event listener send_loop error: #{e.class}: #{e.message}")
|
|
469
520
|
end
|
data/lib/hatchet/workflow.rb
CHANGED
|
@@ -348,6 +348,29 @@ module Hatchet
|
|
|
348
348
|
)
|
|
349
349
|
end
|
|
350
350
|
|
|
351
|
+
# Pause this workflow. While paused, new runs of the workflow are queued but not started.
|
|
352
|
+
#
|
|
353
|
+
# @param queue_ttl [Integer, String] How long runs stay queued while the workflow is paused before they are dropped, in seconds or as a duration string (e.g. "1h30m")
|
|
354
|
+
# @param paused_workflow_cron_run_queue_behavior [String] The behavior of cron runs triggered while the workflow is paused ("QUEUE" or "DROP")
|
|
355
|
+
# @param paused_workflow_scheduled_run_queue_behavior [String] The behavior of scheduled runs triggered while the workflow is paused ("QUEUE" or "DROP")
|
|
356
|
+
# @return [HatchetSdkRest::Workflow] The updated workflow
|
|
357
|
+
# @raise [Hatchet::Error] If no client is associated with the workflow
|
|
358
|
+
def pause(queue_ttl:, **opts)
|
|
359
|
+
raise Error, "No client associated with workflow #{@name}" unless @client
|
|
360
|
+
|
|
361
|
+
@client.workflows.pause(id, queue_ttl: queue_ttl, **opts)
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Unpause this workflow.
|
|
365
|
+
#
|
|
366
|
+
# @return [HatchetSdkRest::Workflow] The updated workflow
|
|
367
|
+
# @raise [Hatchet::Error] If no client is associated with the workflow
|
|
368
|
+
def unpause
|
|
369
|
+
raise Error, "No client associated with workflow #{@name}" unless @client
|
|
370
|
+
|
|
371
|
+
@client.workflows.unpause(id)
|
|
372
|
+
end
|
|
373
|
+
|
|
351
374
|
private
|
|
352
375
|
|
|
353
376
|
# Resolve the workflow UUID by looking up the workflow by name via the REST API.
|
|
@@ -3,6 +3,9 @@ module Hatchet
|
|
|
3
3
|
class DurableEventListener
|
|
4
4
|
DEFAULT_RECONNECT_INTERVAL: Integer
|
|
5
5
|
EVICTION_ACK_TIMEOUT_SECONDS: Float
|
|
6
|
+
WORKER_STATUS_RESEND_INTERVAL_SECONDS: Float
|
|
7
|
+
WORKER_STATUS_RESEND_MIN_PENDING_SECONDS: Float
|
|
8
|
+
WORKER_STATUS_MAX_ENTRIES_PER_REQUEST: Integer
|
|
6
9
|
|
|
7
10
|
class WaitForEvent < Struct[untyped]
|
|
8
11
|
attr_accessor wait_for_conditions: 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.9.0
|
|
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-10-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -217,7 +217,6 @@ files:
|
|
|
217
217
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/log_api.rb
|
|
218
218
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/metadata_api.rb
|
|
219
219
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/observability_api.rb
|
|
220
|
-
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/operator_api.rb
|
|
221
220
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/rate_limits_api.rb
|
|
222
221
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/slack_api.rb
|
|
223
222
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/sns_api.rb
|
|
@@ -378,7 +377,6 @@ files:
|
|
|
378
377
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_cel_debug_response.rb
|
|
379
378
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_cel_debug_response_status.rb
|
|
380
379
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_filter_request.rb
|
|
381
|
-
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_http_operator_request.rb
|
|
382
380
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request.rb
|
|
383
381
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request_api_key.rb
|
|
384
382
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request_base.rb
|
|
@@ -395,8 +393,6 @@ files:
|
|
|
395
393
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_event_workflow_run_summary.rb
|
|
396
394
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_filter.rb
|
|
397
395
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_filter_list.rb
|
|
398
|
-
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator.rb
|
|
399
|
-
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator_list.rb
|
|
400
396
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_log_line.rb
|
|
401
397
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_log_line_level.rb
|
|
402
398
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_log_line_list.rb
|
|
@@ -423,7 +419,6 @@ files:
|
|
|
423
419
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_timing_list.rb
|
|
424
420
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_trigger_workflow_run_request.rb
|
|
425
421
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_filter_request.rb
|
|
426
|
-
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_http_operator_request.rb
|
|
427
422
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_webhook_request.rb
|
|
428
423
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_wait_item.rb
|
|
429
424
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_webhook.rb
|