Skip to content

Commit

Permalink
Fix cleanup/shutdown (#69)
Browse files Browse the repository at this point in the history
Fix remaining mentions of "cleanup"
  • Loading branch information
andrewgodwin committed Oct 24, 2018
2 parents 69013c4 + 3dc982a commit 112457f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions specs/lifespan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Lifespan Protocol
**Version**: 1.0 (2018-09-06)

The Lifespan ASGI sub-specification outlines how to communicate
lifespan events such as startup and cleanup within ASGI. The lifespan
lifespan events such as startup and shutdown within ASGI. The lifespan
being referred to is that of main event loop. In a multi-process
environment there will be lifespan events in each process.

The lifespan messages allow for a application to initialise and
cleanup in the context of a running event loop. An example of this
shutdown in the context of a running event loop. An example of this
would be creating a connection pool and subsequently closing the
connection pool to release the connections.

Expand All @@ -28,17 +28,17 @@ A possible implementation of this protocol is given below::
if message['type'] == 'lifespan.startup':
await self.startup()
await send({'type': 'lifespan.startup.complete'})
elif message['type'] == 'lifespan.cleanup':
await self.cleanup()
await send({'type': 'lifespan.cleanup.complete'})
elif message['type'] == 'lifespan.shutdown':
await self.shutdown()
await send({'type': 'lifespan.shutdown.complete'})
return
else:
pass # Handle other types

async def startup(self):
...

async def cleanup(self):
async def shutdown(self):
...


Expand Down

0 comments on commit 112457f

Please sign in to comment.