asgiref
asgiref copied to clipboard
lifespan: Return required?
The example lifespan application exits after the lifespan.shutdown event but this behavior is not specified in the actual text of the specification.
It's actually not super-clear in the asgi specification how it should be handled.
I don't believe I have an opinion on this, thinking about it - it doesn't really matter, since the server will exit anyway (though most provide a grace period to allow applications to exit before they shut down).
If you want, I'd take a PR suggesting they should try to exit, providing nobody else disagrees.
Not sure if it needs to be specified, but it'd be a reasonable assumption that:
- Applications shouldn't do anything else after after the
lifespan.shutdownmessages. - Servers should probably wait for the application lifespan task to complete, for cleanness.
It doesn't matter. There's no ambiguity on the ecosystem regarding this.
Can we close this?