asgiref icon indicating copy to clipboard operation
asgiref copied to clipboard

lifespan: Return required?

Open AstraLuma opened this issue 5 years ago • 2 comments
trafficstars

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.

AstraLuma avatar Jan 03 '20 04:01 AstraLuma

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.

andrewgodwin avatar Jan 08 '20 17:01 andrewgodwin

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.shutdown messages.
  • Servers should probably wait for the application lifespan task to complete, for cleanness.

lovelydinosaur avatar Jan 13 '20 14:01 lovelydinosaur

It doesn't matter. There's no ambiguity on the ecosystem regarding this.

Can we close this?

Kludex avatar Sep 03 '23 06:09 Kludex