asgi 'lifespan.shutdown'

Bot-Publishing Inc. info at
Mon Dec 28 17:04:35 UTC 2020


I am trying to determine the best way to introduce a resource clean up
logic into a python module that is called using ASGI protocol.

I am successfully catching the *'lifespan.startup' *event  from within my
async def application(scope, receive, send*) *implementation.

Unfortunately, I do not see the *'lifespan.shutdown' *event  when the
process is unloaded.

My config file includes:
      "processes": {
        "max": 3,
        "spare": 1,
        "idle_timeout": 10

I was under the assumption that the above config will force the idle
processes to shut down resulting in the *'lifespan.shutdown' *event .

Would appreciate any assistance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the unit mailing list