blob: 8f315f70ef69159d5f2db80d3927d1564aa63dd7 (
plain) (
tree)
|
|
async def application(scope, receive, send):
if scope['type'] == 'lifespan':
while True:
message = await receive()
if message['type'] == 'lifespan.startup':
await send({"type": "lifespan.startup.failed"})
raise Exception('Exception blah')
elif message['type'] == 'lifespan.shutdown':
await send({'type': 'lifespan.shutdown.complete'})
return
|