-
Notifications
You must be signed in to change notification settings - Fork 7
Description
The current implementation of the restate Python SDK as of version 0.7.3
does not support the lifespan event.
Current Behavior In the file restate/sdk-python/python/restate/server.py
, the following code is present:
async def app(scope: Scope, receive: Receive, send: Send):
try:
if scope['type'] == 'lifespan':
raise LifeSpanNotImplemented()
lifespan
event is necessary for applications that open long-running connections (such as database connections or websockets) and require a clean shutdown or restart mechanism. Currently, there's no workaround for this either. For example, I tried this for connection pool shutdown with the atexit library, but it didn't work.
Request: Please consider implementing ASGI lifespan support in a future release of the restate Python SDK.
Also, I didn't find any contributing.md
, so I do not know how I can proceed with raising a PR and fixing the issue myself.