mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Typo in Example using class-based consumer (#526)
Typo in Example using class-based consumer from section "2.6.3 WebSocket Multiplexing"
This commit is contained in:
parent
b14bbeebe4
commit
4185798731
|
@ -194,7 +194,7 @@ Example using class-based consumer::
|
|||
|
||||
from channels.generic.websockets import WebsocketDemultiplexer, JsonWebsocketConsumer
|
||||
|
||||
class EchoConsumer(websockets.JsonWebsocketConsumer):
|
||||
class EchoConsumer(JsonWebsocketConsumer):
|
||||
def connect(self, message, multiplexer, **kwargs):
|
||||
# Send data with the multiplexer
|
||||
multiplexer.send({"status": "I just connected!"})
|
||||
|
@ -207,7 +207,7 @@ Example using class-based consumer::
|
|||
multiplexer.send({"original_message": content})
|
||||
|
||||
|
||||
class AnotherConsumer(websockets.JsonWebsocketConsumer):
|
||||
class AnotherConsumer(JsonWebsocketConsumer):
|
||||
def receive(self, content, multiplexer=None, **kwargs):
|
||||
# Some other actions here
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue
Block a user