mirror of
https://github.com/django/daphne.git
synced 2025-07-13 01:12:17 +03:00
Added the "flush" extension to ASGI, and clarified group expiry
This commit is contained in:
parent
9f7c0f86c4
commit
717eb0a100
|
@ -178,8 +178,9 @@ code, and so has been made optional in order to enable lightweight
|
||||||
channel layers for applications that don't need the full feature set defined
|
channel layers for applications that don't need the full feature set defined
|
||||||
here.
|
here.
|
||||||
|
|
||||||
There are two extensions defined here: the ``groups`` extension, which
|
There are three extensions defined here: the ``groups`` extension, which
|
||||||
is expanded on below, and the ``statistics`` extension, which allows
|
is expanded on below, the ``flush`` extension, which allows easier testing
|
||||||
|
and development, and the ``statistics`` extension, which allows
|
||||||
channel layers to provide global and per-channel statistics.
|
channel layers to provide global and per-channel statistics.
|
||||||
|
|
||||||
There is potential to add further extensions; these may be defined by
|
There is potential to add further extensions; these may be defined by
|
||||||
|
@ -285,7 +286,7 @@ A *channel layer* should provide an object with these attributes
|
||||||
|
|
||||||
* ``extensions``, a list of unicode string names indicating which
|
* ``extensions``, a list of unicode string names indicating which
|
||||||
extensions this layer provides, or empty if it supports none.
|
extensions this layer provides, or empty if it supports none.
|
||||||
The only valid extension names are ``groups`` and ``statistics`.
|
The only valid extension names are ``groups``, ``flush`` and ``statistics`.
|
||||||
|
|
||||||
A channel layer implementing the ``groups`` extension must also provide:
|
A channel layer implementing the ``groups`` extension must also provide:
|
||||||
|
|
||||||
|
@ -314,7 +315,12 @@ A channel layer implementing the ``statistics`` extension must also provide:
|
||||||
* ``age``, how long the oldest message has been waiting, in seconds
|
* ``age``, how long the oldest message has been waiting, in seconds
|
||||||
* ``per_second``, the number of messages processed in the last second
|
* ``per_second``, the number of messages processed in the last second
|
||||||
|
|
||||||
|
A channel layer implementing the ``flush`` extension must also provide:
|
||||||
|
|
||||||
|
* ``flush()``, a callable that resets the channel layer to no messages and
|
||||||
|
no groups (if groups is implemented). This call must block until the system
|
||||||
|
is cleared and will consistently look empty to any client, if the channel
|
||||||
|
layer is distributed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -359,6 +365,10 @@ protocol servers should quit and hard restart if they detect that the channel
|
||||||
layer has gone down or lost data; shedding all existing connections and letting
|
layer has gone down or lost data; shedding all existing connections and letting
|
||||||
clients reconnect will immediately resolve the problem.
|
clients reconnect will immediately resolve the problem.
|
||||||
|
|
||||||
|
If a channel layer implements the ``groups`` extension, it must persist group
|
||||||
|
membership until at least the time when the member channel has a message
|
||||||
|
expire due to non-consumption.
|
||||||
|
|
||||||
|
|
||||||
Message Formats
|
Message Formats
|
||||||
---------------
|
---------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user