mirror of
https://github.com/django/daphne.git
synced 2025-07-03 11:23:08 +03:00
Stylistic changes
This commit is contained in:
parent
a2d64f9335
commit
1bb48108fd
|
@ -99,8 +99,8 @@ contain only the following types to ensure serializability:
|
||||||
* None
|
* None
|
||||||
|
|
||||||
Channels are identified by a unicode string name consisting only of ASCII
|
Channels are identified by a unicode string name consisting only of ASCII
|
||||||
letters, numbers, numerical digits, periods (``.``), dashes (``-``)
|
letters, ASCII numerical digits, periods (``.``), dashes (``-``) and
|
||||||
and underscores (``_``), plus an optional prefix character (see below).
|
underscores (``_``), plus an optional prefix character (see below).
|
||||||
|
|
||||||
Channels are a first-in, first out queue with at-most-once delivery
|
Channels are a first-in, first out queue with at-most-once delivery
|
||||||
semantics. They can have multiple writers and multiple readers; only a single
|
semantics. They can have multiple writers and multiple readers; only a single
|
||||||
|
@ -116,7 +116,7 @@ application worker process) and *single-reader channels*
|
||||||
|
|
||||||
*Single-reader channel* names are prefixed with an exclamation mark
|
*Single-reader channel* names are prefixed with an exclamation mark
|
||||||
(``!``) character in order to indicate to the channel layer that it may
|
(``!``) character in order to indicate to the channel layer that it may
|
||||||
have to route these channels' data differently to ensure it reaches the
|
have to route the data for these channels differently to ensure it reaches the
|
||||||
single process that needs it; these channels are nearly always tied to
|
single process that needs it; these channels are nearly always tied to
|
||||||
incoming connections from the outside world. Some channel layers may not
|
incoming connections from the outside world. Some channel layers may not
|
||||||
need this, and can simply treat the prefix as part of the name.
|
need this, and can simply treat the prefix as part of the name.
|
||||||
|
@ -125,7 +125,7 @@ Messages should expire after a set time sitting unread in a channel;
|
||||||
the recommendation is one minute, though the best value depends on the
|
the recommendation is one minute, though the best value depends on the
|
||||||
channel layer and the way it is deployed.
|
channel layer and the way it is deployed.
|
||||||
|
|
||||||
Message size is finite, though the maximum varies based on the channel layer
|
The maximum message size is finite, though it varies based on the channel layer
|
||||||
and the encoding it's using. Channel layers may reject messages at ``send()``
|
and the encoding it's using. Channel layers may reject messages at ``send()``
|
||||||
time with a ``MessageTooLarge`` exception; the calling code should take
|
time with a ``MessageTooLarge`` exception; the calling code should take
|
||||||
appropriate action (e.g. HTTP responses can be chunked, while HTTP
|
appropriate action (e.g. HTTP responses can be chunked, while HTTP
|
||||||
|
@ -143,10 +143,10 @@ uploaded videos), and protocol events to/from connected clients.
|
||||||
|
|
||||||
As such, this specification outlines encodings to and from ASGI messages
|
As such, this specification outlines encodings to and from ASGI messages
|
||||||
for three common protocols (HTTP, WebSocket and raw UDP); this allows any ASGI
|
for three common protocols (HTTP, WebSocket and raw UDP); this allows any ASGI
|
||||||
web server to talk to any ASGI web application, and the same for any other
|
web server to talk to any ASGI web application, as well as servers and
|
||||||
protocol with a common specification. It is recommended that if other
|
applications for any other protocol with a common specification. It is
|
||||||
protocols become commonplace they should gain standardized formats in a
|
recommended that if other protocols become commonplace they should gain
|
||||||
supplementary specification of their own.
|
standardized formats in a supplementary specification of their own.
|
||||||
|
|
||||||
The message formats are a key part of the specification; without them,
|
The message formats are a key part of the specification; without them,
|
||||||
the protocol server and web application might be able to talk to each other,
|
the protocol server and web application might be able to talk to each other,
|
||||||
|
@ -262,7 +262,7 @@ Specification Details
|
||||||
A *channel layer* should provide an object with these attributes
|
A *channel layer* should provide an object with these attributes
|
||||||
(all function arguments are positional):
|
(all function arguments are positional):
|
||||||
|
|
||||||
* ``send(channel, message)``, a callable that takes two arguments; the
|
* ``send(channel, message)``, a callable that takes two arguments: the
|
||||||
channel to send on, as a unicode string, and the message
|
channel to send on, as a unicode string, and the message
|
||||||
to send, as a serializable ``dict``.
|
to send, as a serializable ``dict``.
|
||||||
|
|
||||||
|
@ -317,10 +317,10 @@ A channel layer implementing the ``statistics`` extension must also provide:
|
||||||
|
|
||||||
A channel layer implementing the ``flush`` extension must also provide:
|
A channel layer implementing the ``flush`` extension must also provide:
|
||||||
|
|
||||||
* ``flush()``, a callable that resets the channel layer to no messages and
|
* ``flush()``, a callable that resets the channel layer to a blank state,
|
||||||
no groups (if groups is implemented). This call must block until the system
|
containing no messages and no groups (if the groups extension is
|
||||||
is cleared and will consistently look empty to any client, if the channel
|
implemented). This call must block until the system is cleared and will
|
||||||
layer is distributed.
|
consistently look empty to any client, if the channel layer is distributed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user