chore(python-sdk): improved thread cancellation handling, docs, and custom sleep method (#134)

* feat: timeout on python steps

* chore(python-sdk): improved thread handling and docs

* docs: default timeout
This commit is contained in:
abelanger5
2024-01-27 19:14:48 -08:00
committed by GitHub
parent ea820ab66d
commit 40760e0951
11 changed files with 217 additions and 21 deletions
+5 -4
View File
@@ -15,13 +15,14 @@ class MyWorkflow:
print("executed step1")
pass
@hatchet.step(parents=["step1"])
@hatchet.step(parents=["step1"],timeout='4s')
def step2(self, context):
print("executed step2")
pass
print("started step2")
context.sleep(1)
print("finished step2")
workflow = MyWorkflow()
worker = hatchet.worker('test-worker')
worker = hatchet.worker('test-worker', max_threads=4)
worker.register_workflow(workflow)
worker.start()