mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-07 09:19:41 -06:00
* api changes * doc changes * move docs * generated * generate * pkg * backmerge main * revert to main * revert main * race? * remove go tests
25 lines
530 B
Python
25 lines
530 B
Python
import time
|
|
|
|
from hatchet_sdk import Context, EmptyModel, Hatchet
|
|
|
|
hatchet = Hatchet()
|
|
|
|
# > SlotRelease
|
|
|
|
slot_release_workflow = hatchet.workflow(name="SlotReleaseWorkflow")
|
|
|
|
|
|
@slot_release_workflow.task()
|
|
def step1(input: EmptyModel, ctx: Context) -> dict[str, str]:
|
|
print("RESOURCE INTENSIVE PROCESS")
|
|
time.sleep(10)
|
|
|
|
# 👀 Release the slot after the resource-intensive process, so that other steps can run
|
|
ctx.release_slot()
|
|
|
|
print("NON RESOURCE INTENSIVE PROCESS")
|
|
return {"status": "success"}
|
|
|
|
|
|
# !!
|