Skip to content

Commit

Permalink
Clarified ambigious section of lifespan["state"] spec
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangb authored Mar 4, 2023
1 parent ec63b10 commit 627e29b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 0 additions & 6 deletions specs/lifespan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ lifespan protocol. If you want to log an error that occurs during lifespan
startup and prevent the server from starting, then send back
``lifespan.startup.failed`` instead.

The ``extensions["lifespan.state"]`` dict is an empty namespace.
Applications can store arbitrary data in this namespace.
A *shallow copy* of this dictionary will get passed into each request handler.
This key will only be set if the server supports this extension.


Lifespan State
--------------

Expand Down
4 changes: 4 additions & 0 deletions specs/www.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ metadata (mostly from the HTTP request line and headers):
* ``subprotocols`` (*Iterable[Unicode string]*) -- Subprotocols the
client advertised. Optional; if missing defaults to empty list.

* ``state`` Optional(*dict[Unicode string, Any]*) -- A copy of the
namespace passed into the lifespan corresponding to this request. (See :doc:`lifespan`).
Optional; if missing the server does not support this feature.


Connect - ``receive`` event
'''''''''''''''''''''''''''
Expand Down

0 comments on commit 627e29b

Please sign in to comment.