hatchet-sdk 1.2.6__py3-none-any.whl → 1.3.1__py3-none-any.whl
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.
Potentially problematic release.
This version of hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/__init__.py +7 -5
- hatchet_sdk/client.py +14 -6
- hatchet_sdk/clients/admin.py +57 -15
- hatchet_sdk/clients/dispatcher/action_listener.py +2 -2
- hatchet_sdk/clients/dispatcher/dispatcher.py +20 -7
- hatchet_sdk/clients/event_ts.py +25 -5
- hatchet_sdk/clients/listeners/durable_event_listener.py +125 -0
- hatchet_sdk/clients/listeners/pooled_listener.py +255 -0
- hatchet_sdk/clients/listeners/workflow_listener.py +62 -0
- hatchet_sdk/clients/rest/api/api_token_api.py +24 -24
- hatchet_sdk/clients/rest/api/default_api.py +64 -64
- hatchet_sdk/clients/rest/api/event_api.py +64 -64
- hatchet_sdk/clients/rest/api/github_api.py +8 -8
- hatchet_sdk/clients/rest/api/healthcheck_api.py +16 -16
- hatchet_sdk/clients/rest/api/log_api.py +16 -16
- hatchet_sdk/clients/rest/api/metadata_api.py +24 -24
- hatchet_sdk/clients/rest/api/rate_limits_api.py +8 -8
- hatchet_sdk/clients/rest/api/slack_api.py +16 -16
- hatchet_sdk/clients/rest/api/sns_api.py +24 -24
- hatchet_sdk/clients/rest/api/step_run_api.py +56 -56
- hatchet_sdk/clients/rest/api/task_api.py +56 -56
- hatchet_sdk/clients/rest/api/tenant_api.py +128 -128
- hatchet_sdk/clients/rest/api/user_api.py +96 -96
- hatchet_sdk/clients/rest/api/worker_api.py +24 -24
- hatchet_sdk/clients/rest/api/workflow_api.py +144 -144
- hatchet_sdk/clients/rest/api/workflow_run_api.py +48 -48
- hatchet_sdk/clients/rest/api/workflow_runs_api.py +40 -40
- hatchet_sdk/clients/rest/api_client.py +5 -8
- hatchet_sdk/clients/rest/configuration.py +7 -3
- hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +2 -2
- hatchet_sdk/clients/rest/models/v1_task_summary.py +5 -0
- hatchet_sdk/clients/rest/models/v1_workflow_run.py +5 -0
- hatchet_sdk/clients/rest/rest.py +160 -111
- hatchet_sdk/clients/v1/api_client.py +2 -2
- hatchet_sdk/context/context.py +22 -21
- hatchet_sdk/features/cron.py +41 -40
- hatchet_sdk/features/logs.py +7 -6
- hatchet_sdk/features/metrics.py +19 -18
- hatchet_sdk/features/runs.py +88 -68
- hatchet_sdk/features/scheduled.py +42 -42
- hatchet_sdk/features/workers.py +17 -16
- hatchet_sdk/features/workflows.py +15 -14
- hatchet_sdk/hatchet.py +1 -1
- hatchet_sdk/runnables/standalone.py +12 -9
- hatchet_sdk/runnables/task.py +66 -2
- hatchet_sdk/runnables/types.py +8 -0
- hatchet_sdk/runnables/workflow.py +26 -125
- hatchet_sdk/waits.py +8 -8
- hatchet_sdk/worker/runner/run_loop_manager.py +4 -4
- hatchet_sdk/worker/runner/runner.py +22 -11
- hatchet_sdk/worker/worker.py +29 -25
- hatchet_sdk/workflow_run.py +58 -9
- {hatchet_sdk-1.2.6.dist-info → hatchet_sdk-1.3.1.dist-info}/METADATA +1 -1
- {hatchet_sdk-1.2.6.dist-info → hatchet_sdk-1.3.1.dist-info}/RECORD +57 -57
- hatchet_sdk/clients/durable_event_listener.py +0 -329
- hatchet_sdk/clients/workflow_listener.py +0 -288
- hatchet_sdk/utils/aio.py +0 -43
- /hatchet_sdk/clients/{run_event_listener.py → listeners/run_event_listener.py} +0 -0
- {hatchet_sdk-1.2.6.dist-info → hatchet_sdk-1.3.1.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.2.6.dist-info → hatchet_sdk-1.3.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
hatchet_sdk/__init__.py,sha256=
|
|
2
|
-
hatchet_sdk/client.py,sha256=
|
|
3
|
-
hatchet_sdk/clients/admin.py,sha256=
|
|
4
|
-
hatchet_sdk/clients/dispatcher/action_listener.py,sha256=
|
|
5
|
-
hatchet_sdk/clients/dispatcher/dispatcher.py,sha256=
|
|
6
|
-
hatchet_sdk/clients/
|
|
7
|
-
hatchet_sdk/clients/event_ts.py,sha256=tbWLz3NXrwMyIoEm0Q2TfitF5cNEpo3k42jWKciOK8A,1082
|
|
1
|
+
hatchet_sdk/__init__.py,sha256=LUj6VyGVSHCYTQTaoyiVhjyJLOfv6gMCmb-s4hRyISM,10031
|
|
2
|
+
hatchet_sdk/client.py,sha256=tbOeMuaJmgpyYSQg8QUz_J4AdqRNvV9E0aEZpgsiZTE,2207
|
|
3
|
+
hatchet_sdk/clients/admin.py,sha256=qY9-nB8o-jCpQQF65nooemH8HOioXjntp9ethpGke9o,17266
|
|
4
|
+
hatchet_sdk/clients/dispatcher/action_listener.py,sha256=sAboL2Dr59MAPBR3KcJ7sSBfOwnTR3rdsRTJ0bDRuuc,16279
|
|
5
|
+
hatchet_sdk/clients/dispatcher/dispatcher.py,sha256=IL-hDXG8Lzas9FieVuNr47E_3Gvpc-aL4Xu_l385Vp8,8140
|
|
6
|
+
hatchet_sdk/clients/event_ts.py,sha256=OjYc_y1K3fNNZ7QLRJYBDnfgsyUVERkxofYldO4QVVs,1672
|
|
8
7
|
hatchet_sdk/clients/events.py,sha256=sKqzGwkrW_AKWW0Q_rxfwo9jXV5EUpLx7fTQvCNHaVo,5443
|
|
8
|
+
hatchet_sdk/clients/listeners/durable_event_listener.py,sha256=jpqnbZsuouWk3XaOIYL9apaGtVk65eKKq66eBP9klBs,4085
|
|
9
|
+
hatchet_sdk/clients/listeners/pooled_listener.py,sha256=E5WOuqUb53OgN6mL7D1fZJZURscO_ILnIj_FG23ufmE,8330
|
|
10
|
+
hatchet_sdk/clients/listeners/run_event_listener.py,sha256=rIjBLRF7d7FBoEq7RKbmbOA84lX_hHSU26trwnthqV8,10230
|
|
11
|
+
hatchet_sdk/clients/listeners/workflow_listener.py,sha256=EhBZZnHiidDLvAc4r54Re_LJXVypinbgTE9qKBybxj8,2054
|
|
9
12
|
hatchet_sdk/clients/rest/__init__.py,sha256=Bee4HPFiMGDHx5xbHkxxVbLBz_mDgSZUqh-nIhvsD1k,16511
|
|
10
13
|
hatchet_sdk/clients/rest/api/__init__.py,sha256=XWlkH9iwpQvJHDqKe7kWl3MUzcTOaH-JiFZbki_fg_U,1200
|
|
11
|
-
hatchet_sdk/clients/rest/api/api_token_api.py,sha256=
|
|
12
|
-
hatchet_sdk/clients/rest/api/default_api.py,sha256=
|
|
13
|
-
hatchet_sdk/clients/rest/api/event_api.py,sha256=
|
|
14
|
-
hatchet_sdk/clients/rest/api/github_api.py,sha256=
|
|
15
|
-
hatchet_sdk/clients/rest/api/healthcheck_api.py,sha256=
|
|
16
|
-
hatchet_sdk/clients/rest/api/log_api.py,sha256=
|
|
17
|
-
hatchet_sdk/clients/rest/api/metadata_api.py,sha256=
|
|
18
|
-
hatchet_sdk/clients/rest/api/rate_limits_api.py,sha256=
|
|
19
|
-
hatchet_sdk/clients/rest/api/slack_api.py,sha256=
|
|
20
|
-
hatchet_sdk/clients/rest/api/sns_api.py,sha256=
|
|
21
|
-
hatchet_sdk/clients/rest/api/step_run_api.py,sha256=
|
|
22
|
-
hatchet_sdk/clients/rest/api/task_api.py,sha256=
|
|
23
|
-
hatchet_sdk/clients/rest/api/tenant_api.py,sha256=
|
|
24
|
-
hatchet_sdk/clients/rest/api/user_api.py,sha256=
|
|
25
|
-
hatchet_sdk/clients/rest/api/worker_api.py,sha256=
|
|
26
|
-
hatchet_sdk/clients/rest/api/workflow_api.py,sha256=
|
|
27
|
-
hatchet_sdk/clients/rest/api/workflow_run_api.py,sha256=
|
|
28
|
-
hatchet_sdk/clients/rest/api/workflow_runs_api.py,sha256=
|
|
29
|
-
hatchet_sdk/clients/rest/api_client.py,sha256=
|
|
14
|
+
hatchet_sdk/clients/rest/api/api_token_api.py,sha256=xzqMH_-wajBA0qLLs5Ta7tYg4FOLq0NjATyhZ1SV9jo,33433
|
|
15
|
+
hatchet_sdk/clients/rest/api/default_api.py,sha256=Y0jEhatVpdIX_W2MCt_n40K6iKvVegDB70qxexkeZDI,88677
|
|
16
|
+
hatchet_sdk/clients/rest/api/event_api.py,sha256=ke5CMD0KI351dQCD9kgOf_jGsVwQa2b4orJnP0Qy-5c,99770
|
|
17
|
+
hatchet_sdk/clients/rest/api/github_api.py,sha256=yoCCZ33r5rQYp9b2pp36TGzjq-zORSYX1LMp5Ibsll8,12059
|
|
18
|
+
hatchet_sdk/clients/rest/api/healthcheck_api.py,sha256=fr8DOMqCMe4igJFeyi0C2ZmAMlghJszAl2SQJMnUzKc,18683
|
|
19
|
+
hatchet_sdk/clients/rest/api/log_api.py,sha256=YaXZS69ZLin2KbWuUl_BAm6rd6wdfKAaOAEGqhLd_Bw,27048
|
|
20
|
+
hatchet_sdk/clients/rest/api/metadata_api.py,sha256=sUCeXtuh4e_iEIHhjpu-f_Vy-PCX3EvHaOfvTQ0x-tQ,28908
|
|
21
|
+
hatchet_sdk/clients/rest/api/rate_limits_api.py,sha256=e3CIX35R8SkV8LrgLMPCAy6KztrEhfO_96iU-TT70rU,15925
|
|
22
|
+
hatchet_sdk/clients/rest/api/slack_api.py,sha256=0xIUw3_1_3hSTn2yw7fLRO5yb38nYLu5aLM7IE2pnwk,21894
|
|
23
|
+
hatchet_sdk/clients/rest/api/sns_api.py,sha256=1LfhnZEA450uHwtZCoM_wycOeH4UGwfNP1pw4RWSe08,33641
|
|
24
|
+
hatchet_sdk/clients/rest/api/step_run_api.py,sha256=rqP4UIJSkw8DwbDnlEgupBDWUL0jlVH_Rm7bNGMUoG8,84505
|
|
25
|
+
hatchet_sdk/clients/rest/api/task_api.py,sha256=x2m8VTvpYJuWZ58KWS4EnKItlxJgP0Ch8_89t2yKlF8,86367
|
|
26
|
+
hatchet_sdk/clients/rest/api/tenant_api.py,sha256=LYUdJSsg-O-Y_7cuCDdtDHP5P0BQ9ch8RFLQKIiIreQ,177493
|
|
27
|
+
hatchet_sdk/clients/rest/api/user_api.py,sha256=NYuEKLeBjXO4q8gyYq1thtbuRm9m3g0R6-q6LIfv83U,115780
|
|
28
|
+
hatchet_sdk/clients/rest/api/worker_api.py,sha256=56jRXsyK7SDENly2b019EO80d8xOHU4bZnmOmjKY1iQ,33049
|
|
29
|
+
hatchet_sdk/clients/rest/api/workflow_api.py,sha256=o2Dov7KmjjlRmsnZaeOjPMsPWo3G80wD1vqSdCOyxoA,249814
|
|
30
|
+
hatchet_sdk/clients/rest/api/workflow_run_api.py,sha256=Jvge80z6DhlqL9OuLzUC49OtojeiCuagrMbNBThMYI4,78120
|
|
31
|
+
hatchet_sdk/clients/rest/api/workflow_runs_api.py,sha256=_zFmx0DTztKK2xa5BKBYhYqveIbNBc4g9DkNPIJeUxQ,70192
|
|
32
|
+
hatchet_sdk/clients/rest/api_client.py,sha256=g1ECXTfdPHyM2yZuX4FZWZwvl5FZ9dEok0EKyeqLkRA,26813
|
|
30
33
|
hatchet_sdk/clients/rest/api_response.py,sha256=rSuCVGY-HE8X_WwteQP5wyANIuS-L5AmtZEUOwTicak,641
|
|
31
|
-
hatchet_sdk/clients/rest/configuration.py,sha256=
|
|
34
|
+
hatchet_sdk/clients/rest/configuration.py,sha256=ijGxGorVe8OEikJruwJ0hPk1Rc0OAKOqeUrfcoEiYH8,19333
|
|
32
35
|
hatchet_sdk/clients/rest/exceptions.py,sha256=5PTEjyGxLeGP8U_qqc79QzR-sN7SOhzBwknSUC-BU4c,6365
|
|
33
36
|
hatchet_sdk/clients/rest/models/__init__.py,sha256=BAwgrsAKYGiS9A3ZtK2ROF9xjiKa3qA7Z_NqBOGgzXI,14931
|
|
34
37
|
hatchet_sdk/clients/rest/models/accept_invite_request.py,sha256=_otOis3SuTHl0F_hhYD-rYqgyxCXRn83CK_eU9oMdn4,2427
|
|
@@ -133,7 +136,7 @@ hatchet_sdk/clients/rest/models/tenant_queue_metrics.py,sha256=cTZ_ccGXM9XDwksD-
|
|
|
133
136
|
hatchet_sdk/clients/rest/models/tenant_resource.py,sha256=oQX7-Ekg_NAOHWgs59kmxfD8kIzTk5v7-jYtSquEnPg,802
|
|
134
137
|
hatchet_sdk/clients/rest/models/tenant_resource_limit.py,sha256=iVkEliSDbLcdi1EYdh9jfA66Ft1bhCcrIQ2ZC9JgGe8,4236
|
|
135
138
|
hatchet_sdk/clients/rest/models/tenant_resource_policy.py,sha256=laL2UxMLkn3CPULnK3og2tLxoLaCvdcqDYi4er9cAQo,3092
|
|
136
|
-
hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py,sha256=
|
|
139
|
+
hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py,sha256=pkbuRSwrKS2XDUC-7k6wsyiKWlK9ALUPU1Ys-ENgapk,2400
|
|
137
140
|
hatchet_sdk/clients/rest/models/tenant_version.py,sha256=5izyls2uBLE-gHEPfBaRaWOE24k9iM-2T_TB_LYINJ8,649
|
|
138
141
|
hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py,sha256=8l1biY4plhSQFr8w6g4a_pcZjJSBuPO18WjCr4Dz75k,2644
|
|
139
142
|
hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py,sha256=9KfQNVApba-LG49ioR-W16YAfk2W2HanV_RRDugQeho,2488
|
|
@@ -162,10 +165,10 @@ hatchet_sdk/clients/rest/models/v1_task_point_metrics.py,sha256=shKqLFLgNAKua865
|
|
|
162
165
|
hatchet_sdk/clients/rest/models/v1_task_run_metric.py,sha256=8trEgJ_7AHAmUQi2Qty-v5XVjgN3g7VZ6gzMTjeZ1tY,2504
|
|
163
166
|
hatchet_sdk/clients/rest/models/v1_task_run_status.py,sha256=tjipWHHNx7g4lUZBdu_DDZwEqSpxPKv06YiE2Q17cXo,753
|
|
164
167
|
hatchet_sdk/clients/rest/models/v1_task_status.py,sha256=4Hqczjth228k8Y23vIaxAIzTpLaS9mh9I0PrTjY8JRY,742
|
|
165
|
-
hatchet_sdk/clients/rest/models/v1_task_summary.py,sha256=
|
|
168
|
+
hatchet_sdk/clients/rest/models/v1_task_summary.py,sha256=GbHZN4fCkysTgfZKjaaWS-8bAFwgX7l5u4hAKLhDlw4,8371
|
|
166
169
|
hatchet_sdk/clients/rest/models/v1_task_summary_list.py,sha256=0m-xf_lY9BwwbLky9i6fkTYUwh2K9mADHVZoRyF66o4,3510
|
|
167
170
|
hatchet_sdk/clients/rest/models/v1_trigger_workflow_run_request.py,sha256=tlveXz8hM8xnn36PhtPokyHljjrkPDSI3ZniSutdYT0,2850
|
|
168
|
-
hatchet_sdk/clients/rest/models/v1_workflow_run.py,sha256=
|
|
171
|
+
hatchet_sdk/clients/rest/models/v1_workflow_run.py,sha256=0kgHJ35XjXgNfaJfb1p0KLS1Jw6VAMeMYSdts8EvuYc,5895
|
|
169
172
|
hatchet_sdk/clients/rest/models/v1_workflow_run_details.py,sha256=vMnc50mT-tjfFlg2BJ58s2HhFvqvuGJaPGYAlTrLVI4,5040
|
|
170
173
|
hatchet_sdk/clients/rest/models/v1_workflow_run_display_name.py,sha256=0r6ASZvs6zUzW-YcJGbhkV_cs6N7jl-5l7f_LLgvBVY,2982
|
|
171
174
|
hatchet_sdk/clients/rest/models/v1_workflow_run_display_name_list.py,sha256=7jvuNbkjNGRKuZ2TdF1o_ghSLuQB2G-QE6agU-tObCE,3631
|
|
@@ -212,15 +215,13 @@ hatchet_sdk/clients/rest/models/workflow_version_concurrency.py,sha256=ExPeo4cKc
|
|
|
212
215
|
hatchet_sdk/clients/rest/models/workflow_version_definition.py,sha256=e18BUh1XO06i5bVrdEYHzTHReco7_6gIrcB6QoCANV8,2526
|
|
213
216
|
hatchet_sdk/clients/rest/models/workflow_version_meta.py,sha256=TW4R7bAuYAg_LraN-8psdZqp2E8wH9hYyL5Sji86aLk,3791
|
|
214
217
|
hatchet_sdk/clients/rest/models/workflow_workers_count.py,sha256=qhzqfvjjIDyARkiiLGluMIqEmqO-diHTsjlu0Doi0yg,2875
|
|
215
|
-
hatchet_sdk/clients/rest/rest.py,sha256=
|
|
218
|
+
hatchet_sdk/clients/rest/rest.py,sha256=zZHTzgl-NBdcK6XhG23m_s9RKRONGPPItzGe407s7GA,9262
|
|
216
219
|
hatchet_sdk/clients/rest/tenacity_utils.py,sha256=n6QvwuGwinLQpiWNU5GxrDNhFBE8_wZdg3WNur21rJ0,1055
|
|
217
|
-
hatchet_sdk/clients/
|
|
218
|
-
hatchet_sdk/clients/v1/api_client.py,sha256=L5dbAvIJMnoe9oiUuwLJx8Atn_NTpCctGJ_cXxE-KFs,1247
|
|
219
|
-
hatchet_sdk/clients/workflow_listener.py,sha256=x6FQ8d786MiubARPG0B92L3Jbs4Ve0CQJFx_udJIB3s,10522
|
|
220
|
+
hatchet_sdk/clients/v1/api_client.py,sha256=mJQUZ3cOxlFJiwWKK5F8jBxcpNZ7A2292HucrBqurbg,1205
|
|
220
221
|
hatchet_sdk/config.py,sha256=jJA76BOvVdfOQHy6TKclAvr2qyblcM-Pz5J-hVAdpQ4,3588
|
|
221
222
|
hatchet_sdk/connection.py,sha256=B5gT5NL9BBB5-l9U_cN6pMlraQk880rEYMnqaK_dgL0,2590
|
|
222
223
|
hatchet_sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
223
|
-
hatchet_sdk/context/context.py,sha256=
|
|
224
|
+
hatchet_sdk/context/context.py,sha256=FUClTuxFETBAljI0gknOdqkCEgkY2EX1lOx2xib2xzk,9659
|
|
224
225
|
hatchet_sdk/context/worker_context.py,sha256=OVcEWvdT_Kpd0nlg61VAPUgIPSFzSLs0aSrXWj-1GX4,974
|
|
225
226
|
hatchet_sdk/contracts/dispatcher_pb2.py,sha256=SN4CIKeQwYkrbfRGhdhZo2uBn4nGzjUWIC1vvXdDeOQ,14503
|
|
226
227
|
hatchet_sdk/contracts/dispatcher_pb2.pyi,sha256=ZSGio5eYxkw-QuQx2C5ASTNcKzeMQn5JTnWaRiThafM,18455
|
|
@@ -241,15 +242,15 @@ hatchet_sdk/contracts/workflows_pb2.py,sha256=9j6-YMrtgp2yxX-BePwyaqxuFhrI6OftoZ
|
|
|
241
242
|
hatchet_sdk/contracts/workflows_pb2.pyi,sha256=2r5d4DWaR0kwY8jKSzcffTAMMlWrusRXCziE_03SFYc,15434
|
|
242
243
|
hatchet_sdk/contracts/workflows_pb2_grpc.py,sha256=2V8E72DlJx5qlH2yiQpVCu5cQbKUba5X7T1yNrQDF_s,10819
|
|
243
244
|
hatchet_sdk/exceptions.py,sha256=HGmYSZy3bCY2rBDEOQfhYGRa7_j9GvYT9Pc0B8Ic5Ug,49
|
|
244
|
-
hatchet_sdk/features/cron.py,sha256=
|
|
245
|
-
hatchet_sdk/features/logs.py,sha256=
|
|
246
|
-
hatchet_sdk/features/metrics.py,sha256=
|
|
245
|
+
hatchet_sdk/features/cron.py,sha256=eoS4hADSbae_rR-1J2Ng31WdJM-_neFSb2JcfKkXcMs,9132
|
|
246
|
+
hatchet_sdk/features/logs.py,sha256=LxyXsedewyiVhSFfGvDYxOA8FzTp8evKk8jeaonbwXo,674
|
|
247
|
+
hatchet_sdk/features/metrics.py,sha256=Rw6J2u-2sfb6p7dhcCJerrD2q62LZqaStJj0WvISGDY,2823
|
|
247
248
|
hatchet_sdk/features/rate_limits.py,sha256=Df-DBFRpT1MHRf7qcvD4YJseNuFJUp5X9aO72yLkW6Q,1521
|
|
248
|
-
hatchet_sdk/features/runs.py,sha256=
|
|
249
|
-
hatchet_sdk/features/scheduled.py,sha256=
|
|
250
|
-
hatchet_sdk/features/workers.py,sha256=
|
|
251
|
-
hatchet_sdk/features/workflows.py,sha256=
|
|
252
|
-
hatchet_sdk/hatchet.py,sha256=
|
|
249
|
+
hatchet_sdk/features/runs.py,sha256=2069-4YUaouYloFUxa3-WmtkWhCjEIGMeGrN_nlnYCA,9089
|
|
250
|
+
hatchet_sdk/features/scheduled.py,sha256=1_GMP7jSC9UCFFWLVES5HtTGQInQd9cJeqJDhq0Hnmg,8813
|
|
251
|
+
hatchet_sdk/features/workers.py,sha256=fG8zoRXMm-lNNdNfeovKKpmJ0RzjZd6CIq_dVsu-ih0,1515
|
|
252
|
+
hatchet_sdk/features/workflows.py,sha256=x1Z_HZM_ZQZbWZhOfzJaEiPfRNSn6YX3IaTmFZ5D7MY,2069
|
|
253
|
+
hatchet_sdk/hatchet.py,sha256=7wDYLGBlPdQ0IvnJUdAe8Ms2B9IZWpedRED4AflZCW0,22982
|
|
253
254
|
hatchet_sdk/labels.py,sha256=nATgxWE3lFxRTnfISEpoIRLGbMfAZsHF4lZTuG4Mfic,182
|
|
254
255
|
hatchet_sdk/logger.py,sha256=5uOr52T4mImSQm1QvWT8HvZFK5WfPNh3Y1cBQZRFgUQ,333
|
|
255
256
|
hatchet_sdk/metadata.py,sha256=XkRbhnghJJGCdVvF-uzyGBcNaTqpeQ3uiQvNNP1wyBc,107
|
|
@@ -257,12 +258,11 @@ hatchet_sdk/opentelemetry/instrumentor.py,sha256=KYZG1koVv4704kgr7YJ-M3QqRcTrZI2
|
|
|
257
258
|
hatchet_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
258
259
|
hatchet_sdk/rate_limit.py,sha256=TwbCuggiZaWpYuo4mjVLlE-z1OfQ2mRBiVvCSaG3lv4,3919
|
|
259
260
|
hatchet_sdk/runnables/contextvars.py,sha256=6MDocAMmlyiRW37oQ1jyx10tAlJs-xgDjR3xPoPz05g,426
|
|
260
|
-
hatchet_sdk/runnables/standalone.py,sha256=
|
|
261
|
-
hatchet_sdk/runnables/task.py,sha256=
|
|
262
|
-
hatchet_sdk/runnables/types.py,sha256=
|
|
263
|
-
hatchet_sdk/runnables/workflow.py,sha256=
|
|
261
|
+
hatchet_sdk/runnables/standalone.py,sha256=KyKA3UeuyU_IK0t-c0Q56Lm-W4rewILkfHlenjos474,6276
|
|
262
|
+
hatchet_sdk/runnables/task.py,sha256=R7QpxHsMKQSp6V84NeQ8oFdTNLPY77Ocx0MM1Q3xX40,7164
|
|
263
|
+
hatchet_sdk/runnables/types.py,sha256=1Y2mS7bDVY86rE7SSMzt9KKcF8qGiaiEmQ85jR8DMT4,4500
|
|
264
|
+
hatchet_sdk/runnables/workflow.py,sha256=FcmN7-cmI32GnnkKGKhUL2xV3z7vfBK43LmJVuKKiyo,27771
|
|
264
265
|
hatchet_sdk/token.py,sha256=KjIiInwG5Kqd_FO4BSW1x_5Uc7PFbnzIVJqr50-ZldE,779
|
|
265
|
-
hatchet_sdk/utils/aio.py,sha256=A9pKNn8eAKUeinY2uBkJn4jdrYI5vAw_A-gzz04xdvQ,1122
|
|
266
266
|
hatchet_sdk/utils/backoff.py,sha256=6B5Rb5nLKw_TqqgpJMYjIBV1PTTtbOMRZCveisVhg_I,353
|
|
267
267
|
hatchet_sdk/utils/proto_enums.py,sha256=0UybwE3s7TcqmzoQSO8YnhgAKOS8WZXsyPchB8-eksw,1247
|
|
268
268
|
hatchet_sdk/utils/timedelta_to_expression.py,sha256=n5jIxlcswN9GwFPjktuMceedekzWWT6X7U6gbsZciIQ,455
|
|
@@ -498,15 +498,15 @@ hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py,sha256=Iih_s8JNqrinXE
|
|
|
498
498
|
hatchet_sdk/v0/worker/worker.py,sha256=0yU0z-0si7NzG0U9et9J0tiwfVBSHl4QSiOW-WNmTQM,13027
|
|
499
499
|
hatchet_sdk/v0/workflow.py,sha256=d4o425efk7J3JgLIge34MW_A3pzwnwSRtwEOgIqM2pc,9387
|
|
500
500
|
hatchet_sdk/v0/workflow_run.py,sha256=jsEZprXshrSV7i_TtL5uoCL03D18zQ3NeJCq7mp97Dg,1752
|
|
501
|
-
hatchet_sdk/waits.py,sha256=
|
|
501
|
+
hatchet_sdk/waits.py,sha256=dTrelK8Lk0W5anq3TlpJwAK5z8TJ0FW7XgoSg8bf8fA,3351
|
|
502
502
|
hatchet_sdk/worker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
503
503
|
hatchet_sdk/worker/action_listener_process.py,sha256=KxS7-wBpfKnsq0LNSvk-MG442Lh60iQMy3VpD1FW3mU,11703
|
|
504
|
-
hatchet_sdk/worker/runner/run_loop_manager.py,sha256=
|
|
505
|
-
hatchet_sdk/worker/runner/runner.py,sha256=
|
|
504
|
+
hatchet_sdk/worker/runner/run_loop_manager.py,sha256=P0iyKSfAb0IW5LDUnwzUOgCp0lPpAAKXCkeTXGQq8oY,3893
|
|
505
|
+
hatchet_sdk/worker/runner/runner.py,sha256=mfEsR2EDcKPkEIylkz3FLsMC33OqTs4r5zpxCIjitoc,17446
|
|
506
506
|
hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=nHRPSiDBqzhObM7i2X7t03OupVFnE7kQBdR2Ckgg-2w,2709
|
|
507
|
-
hatchet_sdk/worker/worker.py,sha256=
|
|
508
|
-
hatchet_sdk/workflow_run.py,sha256=
|
|
509
|
-
hatchet_sdk-1.
|
|
510
|
-
hatchet_sdk-1.
|
|
511
|
-
hatchet_sdk-1.
|
|
512
|
-
hatchet_sdk-1.
|
|
507
|
+
hatchet_sdk/worker/worker.py,sha256=dcJEMeogodhLEi_5a0ldJLZ5EEN7DNcr8aiFLknTb18,14667
|
|
508
|
+
hatchet_sdk/workflow_run.py,sha256=ZwH0HLFGFVXz6jbiqSv4w0Om2XuR52Tzzw6LH4y65jQ,2765
|
|
509
|
+
hatchet_sdk-1.3.1.dist-info/METADATA,sha256=sS8Lrxkr6HvdjuhsP0vmjACIGE_pXxfGBH6uyzvgF1M,3571
|
|
510
|
+
hatchet_sdk-1.3.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
511
|
+
hatchet_sdk-1.3.1.dist-info/entry_points.txt,sha256=5mTp_AsCWK5raiVxP_MU9eBCgkRGl4OsN6chpHcvm7o,1235
|
|
512
|
+
hatchet_sdk-1.3.1.dist-info/RECORD,,
|
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
import json
|
|
3
|
-
from collections.abc import AsyncIterator
|
|
4
|
-
from typing import Any, Literal, cast
|
|
5
|
-
|
|
6
|
-
import grpc
|
|
7
|
-
import grpc.aio
|
|
8
|
-
from grpc._cython import cygrpc # type: ignore[attr-defined]
|
|
9
|
-
from pydantic import BaseModel, ConfigDict
|
|
10
|
-
|
|
11
|
-
from hatchet_sdk.clients.event_ts import ThreadSafeEvent, read_with_interrupt
|
|
12
|
-
from hatchet_sdk.clients.rest.tenacity_utils import tenacity_retry
|
|
13
|
-
from hatchet_sdk.config import ClientConfig
|
|
14
|
-
from hatchet_sdk.connection import new_conn
|
|
15
|
-
from hatchet_sdk.contracts.v1.dispatcher_pb2 import (
|
|
16
|
-
DurableEvent,
|
|
17
|
-
ListenForDurableEventRequest,
|
|
18
|
-
)
|
|
19
|
-
from hatchet_sdk.contracts.v1.dispatcher_pb2 import (
|
|
20
|
-
RegisterDurableEventRequest as RegisterDurableEventRequestProto,
|
|
21
|
-
)
|
|
22
|
-
from hatchet_sdk.contracts.v1.dispatcher_pb2_grpc import V1DispatcherStub
|
|
23
|
-
from hatchet_sdk.contracts.v1.shared.condition_pb2 import DurableEventListenerConditions
|
|
24
|
-
from hatchet_sdk.logger import logger
|
|
25
|
-
from hatchet_sdk.metadata import get_metadata
|
|
26
|
-
from hatchet_sdk.waits import SleepCondition, UserEventCondition
|
|
27
|
-
|
|
28
|
-
DEFAULT_DURABLE_EVENT_LISTENER_RETRY_INTERVAL = 3 # seconds
|
|
29
|
-
DEFAULT_DURABLE_EVENT_LISTENER_RETRY_COUNT = 5
|
|
30
|
-
DEFAULT_DURABLE_EVENT_LISTENER_INTERRUPT_INTERVAL = 1800 # 30 minutes
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class _Subscription:
|
|
34
|
-
def __init__(self, id: int, task_id: str, signal_key: str):
|
|
35
|
-
self.id = id
|
|
36
|
-
self.task_id = task_id
|
|
37
|
-
self.signal_key = signal_key
|
|
38
|
-
self.queue: asyncio.Queue[DurableEvent | None] = asyncio.Queue()
|
|
39
|
-
|
|
40
|
-
async def __aiter__(self) -> "_Subscription":
|
|
41
|
-
return self
|
|
42
|
-
|
|
43
|
-
async def __anext__(self) -> DurableEvent | None:
|
|
44
|
-
return await self.queue.get()
|
|
45
|
-
|
|
46
|
-
async def get(self) -> DurableEvent:
|
|
47
|
-
event = await self.queue.get()
|
|
48
|
-
|
|
49
|
-
if event is None:
|
|
50
|
-
raise StopAsyncIteration
|
|
51
|
-
|
|
52
|
-
return event
|
|
53
|
-
|
|
54
|
-
async def put(self, item: DurableEvent) -> None:
|
|
55
|
-
await self.queue.put(item)
|
|
56
|
-
|
|
57
|
-
async def close(self) -> None:
|
|
58
|
-
await self.queue.put(None)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
class RegisterDurableEventRequest(BaseModel):
|
|
62
|
-
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
63
|
-
|
|
64
|
-
task_id: str
|
|
65
|
-
signal_key: str
|
|
66
|
-
conditions: list[SleepCondition | UserEventCondition]
|
|
67
|
-
|
|
68
|
-
def to_proto(self) -> RegisterDurableEventRequestProto:
|
|
69
|
-
return RegisterDurableEventRequestProto(
|
|
70
|
-
task_id=self.task_id,
|
|
71
|
-
signal_key=self.signal_key,
|
|
72
|
-
conditions=DurableEventListenerConditions(
|
|
73
|
-
sleep_conditions=[
|
|
74
|
-
c.to_pb() for c in self.conditions if isinstance(c, SleepCondition)
|
|
75
|
-
],
|
|
76
|
-
user_event_conditions=[
|
|
77
|
-
c.to_pb()
|
|
78
|
-
for c in self.conditions
|
|
79
|
-
if isinstance(c, UserEventCondition)
|
|
80
|
-
],
|
|
81
|
-
),
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class DurableEventListener:
|
|
86
|
-
def __init__(self, config: ClientConfig):
|
|
87
|
-
self.token = config.token
|
|
88
|
-
self.config = config
|
|
89
|
-
|
|
90
|
-
# list of all active subscriptions, mapping from a subscription id to a task id and signal key
|
|
91
|
-
self.subscriptions_to_task_id_signal_key: dict[int, tuple[str, str]] = {}
|
|
92
|
-
|
|
93
|
-
# task id-signal key tuples mapped to an array of subscription ids
|
|
94
|
-
self.task_id_signal_key_to_subscriptions: dict[tuple[str, str], list[int]] = {}
|
|
95
|
-
|
|
96
|
-
self.subscription_counter: int = 0
|
|
97
|
-
self.subscription_counter_lock: asyncio.Lock = asyncio.Lock()
|
|
98
|
-
|
|
99
|
-
self.requests: asyncio.Queue[ListenForDurableEventRequest | int] = (
|
|
100
|
-
asyncio.Queue()
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
self.listener: (
|
|
104
|
-
grpc.aio.UnaryStreamCall[ListenForDurableEventRequest, DurableEvent] | None
|
|
105
|
-
) = None
|
|
106
|
-
self.listener_task: asyncio.Task[None] | None = None
|
|
107
|
-
|
|
108
|
-
self.curr_requester: int = 0
|
|
109
|
-
|
|
110
|
-
self.events: dict[int, _Subscription] = {}
|
|
111
|
-
|
|
112
|
-
self.interrupter: asyncio.Task[None] | None = None
|
|
113
|
-
|
|
114
|
-
async def _interrupter(self) -> None:
|
|
115
|
-
"""
|
|
116
|
-
_interrupter runs in a separate thread and interrupts the listener according to a configurable duration.
|
|
117
|
-
"""
|
|
118
|
-
await asyncio.sleep(DEFAULT_DURABLE_EVENT_LISTENER_INTERRUPT_INTERVAL)
|
|
119
|
-
|
|
120
|
-
if self.interrupt is not None:
|
|
121
|
-
self.interrupt.set()
|
|
122
|
-
|
|
123
|
-
async def _init_producer(self) -> None:
|
|
124
|
-
conn = new_conn(self.config, True)
|
|
125
|
-
client = V1DispatcherStub(conn)
|
|
126
|
-
|
|
127
|
-
try:
|
|
128
|
-
if not self.listener:
|
|
129
|
-
while True:
|
|
130
|
-
try:
|
|
131
|
-
self.listener = await self._retry_subscribe(client)
|
|
132
|
-
|
|
133
|
-
logger.debug("Workflow run listener connected.")
|
|
134
|
-
|
|
135
|
-
# spawn an interrupter task
|
|
136
|
-
if self.interrupter is not None and not self.interrupter.done():
|
|
137
|
-
self.interrupter.cancel()
|
|
138
|
-
|
|
139
|
-
self.interrupter = asyncio.create_task(self._interrupter())
|
|
140
|
-
|
|
141
|
-
while True:
|
|
142
|
-
self.interrupt = ThreadSafeEvent()
|
|
143
|
-
if self.listener is None:
|
|
144
|
-
continue
|
|
145
|
-
|
|
146
|
-
t = asyncio.create_task(
|
|
147
|
-
read_with_interrupt(self.listener, self.interrupt)
|
|
148
|
-
)
|
|
149
|
-
await self.interrupt.wait()
|
|
150
|
-
|
|
151
|
-
if not t.done():
|
|
152
|
-
logger.warning(
|
|
153
|
-
"Interrupted read_with_interrupt task of durable event listener"
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
t.cancel()
|
|
157
|
-
self.listener.cancel()
|
|
158
|
-
|
|
159
|
-
await asyncio.sleep(
|
|
160
|
-
DEFAULT_DURABLE_EVENT_LISTENER_RETRY_INTERVAL
|
|
161
|
-
)
|
|
162
|
-
break
|
|
163
|
-
|
|
164
|
-
event = t.result()
|
|
165
|
-
|
|
166
|
-
if event is cygrpc.EOF:
|
|
167
|
-
break
|
|
168
|
-
|
|
169
|
-
# get a list of subscriptions for this task-signal pair
|
|
170
|
-
subscriptions = (
|
|
171
|
-
self.task_id_signal_key_to_subscriptions.get(
|
|
172
|
-
(event.task_id, event.signal_key), []
|
|
173
|
-
)
|
|
174
|
-
)
|
|
175
|
-
|
|
176
|
-
for subscription_id in subscriptions:
|
|
177
|
-
await self.events[subscription_id].put(event)
|
|
178
|
-
|
|
179
|
-
except grpc.RpcError as e:
|
|
180
|
-
logger.debug(f"grpc error in durable event listener: {e}")
|
|
181
|
-
await asyncio.sleep(
|
|
182
|
-
DEFAULT_DURABLE_EVENT_LISTENER_RETRY_INTERVAL
|
|
183
|
-
)
|
|
184
|
-
continue
|
|
185
|
-
|
|
186
|
-
except Exception as e:
|
|
187
|
-
logger.error(f"Error in durable event listener: {e}")
|
|
188
|
-
|
|
189
|
-
self.listener = None
|
|
190
|
-
|
|
191
|
-
# close all subscriptions
|
|
192
|
-
for subscription_id in self.events:
|
|
193
|
-
await self.events[subscription_id].close()
|
|
194
|
-
|
|
195
|
-
raise e
|
|
196
|
-
|
|
197
|
-
async def _request(self) -> AsyncIterator[ListenForDurableEventRequest]:
|
|
198
|
-
self.curr_requester = self.curr_requester + 1
|
|
199
|
-
|
|
200
|
-
# replay all existing subscriptions
|
|
201
|
-
for task_id, signal_key in set(
|
|
202
|
-
self.subscriptions_to_task_id_signal_key.values()
|
|
203
|
-
):
|
|
204
|
-
yield ListenForDurableEventRequest(
|
|
205
|
-
task_id=task_id,
|
|
206
|
-
signal_key=signal_key,
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
while True:
|
|
210
|
-
request = await self.requests.get()
|
|
211
|
-
|
|
212
|
-
# if the request is an int which matches the current requester, then we should stop
|
|
213
|
-
if request == self.curr_requester:
|
|
214
|
-
break
|
|
215
|
-
|
|
216
|
-
# if we've gotten an int that doesn't match the current requester, then we should ignore it
|
|
217
|
-
if isinstance(request, int):
|
|
218
|
-
continue
|
|
219
|
-
|
|
220
|
-
yield request
|
|
221
|
-
self.requests.task_done()
|
|
222
|
-
|
|
223
|
-
def cleanup_subscription(self, subscription_id: int) -> None:
|
|
224
|
-
task_id_signal_key = self.subscriptions_to_task_id_signal_key[subscription_id]
|
|
225
|
-
|
|
226
|
-
if task_id_signal_key in self.task_id_signal_key_to_subscriptions:
|
|
227
|
-
self.task_id_signal_key_to_subscriptions[task_id_signal_key].remove(
|
|
228
|
-
subscription_id
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
del self.subscriptions_to_task_id_signal_key[subscription_id]
|
|
232
|
-
del self.events[subscription_id]
|
|
233
|
-
|
|
234
|
-
async def subscribe(self, task_id: str, signal_key: str) -> DurableEvent:
|
|
235
|
-
subscription_id: int | None = None
|
|
236
|
-
|
|
237
|
-
try:
|
|
238
|
-
# create a new subscription id, place a mutex on the counter
|
|
239
|
-
async with self.subscription_counter_lock:
|
|
240
|
-
self.subscription_counter += 1
|
|
241
|
-
subscription_id = self.subscription_counter
|
|
242
|
-
|
|
243
|
-
self.subscriptions_to_task_id_signal_key[subscription_id] = (
|
|
244
|
-
task_id,
|
|
245
|
-
signal_key,
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
if (task_id, signal_key) not in self.task_id_signal_key_to_subscriptions:
|
|
249
|
-
self.task_id_signal_key_to_subscriptions[(task_id, signal_key)] = [
|
|
250
|
-
subscription_id
|
|
251
|
-
]
|
|
252
|
-
else:
|
|
253
|
-
self.task_id_signal_key_to_subscriptions[(task_id, signal_key)].append(
|
|
254
|
-
subscription_id
|
|
255
|
-
)
|
|
256
|
-
|
|
257
|
-
self.events[subscription_id] = _Subscription(
|
|
258
|
-
subscription_id, task_id, signal_key
|
|
259
|
-
)
|
|
260
|
-
|
|
261
|
-
await self.requests.put(
|
|
262
|
-
ListenForDurableEventRequest(
|
|
263
|
-
task_id=task_id,
|
|
264
|
-
signal_key=signal_key,
|
|
265
|
-
)
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
if not self.listener_task or self.listener_task.done():
|
|
269
|
-
self.listener_task = asyncio.create_task(self._init_producer())
|
|
270
|
-
|
|
271
|
-
return await self.events[subscription_id].get()
|
|
272
|
-
except asyncio.CancelledError:
|
|
273
|
-
raise
|
|
274
|
-
finally:
|
|
275
|
-
if subscription_id:
|
|
276
|
-
self.cleanup_subscription(subscription_id)
|
|
277
|
-
|
|
278
|
-
async def _retry_subscribe(
|
|
279
|
-
self,
|
|
280
|
-
client: V1DispatcherStub,
|
|
281
|
-
) -> grpc.aio.UnaryStreamCall[ListenForDurableEventRequest, DurableEvent]:
|
|
282
|
-
retries = 0
|
|
283
|
-
|
|
284
|
-
while retries < DEFAULT_DURABLE_EVENT_LISTENER_RETRY_COUNT:
|
|
285
|
-
try:
|
|
286
|
-
if retries > 0:
|
|
287
|
-
await asyncio.sleep(DEFAULT_DURABLE_EVENT_LISTENER_RETRY_INTERVAL)
|
|
288
|
-
|
|
289
|
-
# signal previous async iterator to stop
|
|
290
|
-
if self.curr_requester != 0:
|
|
291
|
-
self.requests.put_nowait(self.curr_requester)
|
|
292
|
-
|
|
293
|
-
return cast(
|
|
294
|
-
grpc.aio.UnaryStreamCall[
|
|
295
|
-
ListenForDurableEventRequest, DurableEvent
|
|
296
|
-
],
|
|
297
|
-
client.ListenForDurableEvent(
|
|
298
|
-
self._request(), # type: ignore[arg-type]
|
|
299
|
-
metadata=get_metadata(self.token),
|
|
300
|
-
),
|
|
301
|
-
)
|
|
302
|
-
except grpc.RpcError as e:
|
|
303
|
-
if e.code() == grpc.StatusCode.UNAVAILABLE:
|
|
304
|
-
retries = retries + 1
|
|
305
|
-
else:
|
|
306
|
-
raise ValueError(f"gRPC error: {e}")
|
|
307
|
-
|
|
308
|
-
raise ValueError("Failed to connect to durable event listener")
|
|
309
|
-
|
|
310
|
-
@tenacity_retry
|
|
311
|
-
def register_durable_event(
|
|
312
|
-
self, request: RegisterDurableEventRequest
|
|
313
|
-
) -> Literal[True]:
|
|
314
|
-
conn = new_conn(self.config, True)
|
|
315
|
-
client = V1DispatcherStub(conn)
|
|
316
|
-
|
|
317
|
-
client.RegisterDurableEvent(
|
|
318
|
-
request.to_proto(),
|
|
319
|
-
timeout=5,
|
|
320
|
-
metadata=get_metadata(self.token),
|
|
321
|
-
)
|
|
322
|
-
|
|
323
|
-
return True
|
|
324
|
-
|
|
325
|
-
@tenacity_retry
|
|
326
|
-
async def result(self, task_id: str, signal_key: str) -> dict[str, Any]:
|
|
327
|
-
event = await self.subscribe(task_id, signal_key)
|
|
328
|
-
|
|
329
|
-
return cast(dict[str, Any], json.loads(event.data.decode("utf-8")))
|