hatchet-dev / hatchet-python

Hatchet Python SDK for Interacting with the Hatchet Engine
23 stars 12 forks source link

fix: wait for tasks on graceful termination #51

Closed abelanger5 closed 3 months ago

abelanger5 commented 3 months ago

Adds support for awaiting all running tasks when a sigint/sigterm handler is received.

Note that Unregister (internally calling Unsubscribe) is called as early as possible - there need to be some small changes to the Hatchet engine so that we track a shutdown state on the workers, so that new tasks stop being assigned but old tasks continue to be assigned to the worker.