You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you clarify the request a bit? A worker is running and using what it has until run returns (or if you're using async with, until that block is done). A worker's run does not return until it is shutdown and all activities are done (see https://github.com/temporalio/sdk-python?tab=readme-ov-file#worker-shutdown). You should add your client close after the worker run is complete.
Why not to include the implementation of aexit to some kind of asynd def cleanup(...)? Or maybe worker.shutdown is sufficient?
Worker shutdown should be sufficient. If you add your cleanup code after worker is shutdown (or after context manager is complete), that is enough to guarantee the worker isn't using things anymore. A worker lifetime is the life of its run or context manager, both will not complete while any activities are still running (neither will the shutdown call), add any cleanup after that as needed.
It would be nice to have some kind of lifespan for worker instances.
In my case i need shared http client (httpx.AsyncClient) for my activities, and i now don't see a proper place to call
await client.aclose()
.The text was updated successfully, but these errors were encountered: