mirror of
https://github.com/django/daphne.git
synced 2025-08-04 10:30:08 +03:00
Update faqs.rst
Add the example of non-Django application.
This commit is contained in:
parent
4d524f2d00
commit
60700da0df
|
@ -136,7 +136,12 @@ a few choices:
|
|||
(see :doc:`deploying`), you can import the channel layer directly as
|
||||
``yourproject.asgi.channel_layer`` and call ``send()`` and ``receive_many()``
|
||||
on it directly. See the :doc:`ASGI spec <asgi>` for the API the channel layer
|
||||
presents.
|
||||
presents. Here's what that looks like:
|
||||
|
||||
>>> from mysite.asgi import channel_layer
|
||||
>>> from channels import Channel, Group
|
||||
>>> Channel("channel_name").send({"text":"channel_text"})
|
||||
>>> Group("group_name").send({"text":"group_text"})
|
||||
|
||||
* If you just need to send messages in when events happen, you can make a
|
||||
management command that calls ``Channel("namehere").send({...})``
|
||||
|
|
Loading…
Reference in New Issue
Block a user