mirror of
https://github.com/django/daphne.git
synced 2025-07-14 18:02:17 +03:00
Implement default websocket.connect consumer.
This commit is contained in:
parent
69168545d4
commit
be127611e5
|
@ -53,6 +53,10 @@ class Router(object):
|
||||||
# called once, thankfully.
|
# called once, thankfully.
|
||||||
from .handler import ViewConsumer
|
from .handler import ViewConsumer
|
||||||
self.add_route(Route("http.request", http_consumer or ViewConsumer()))
|
self.add_route(Route("http.request", http_consumer or ViewConsumer()))
|
||||||
|
# We also add a no-op websocket.connect consumer to the bottom, as the
|
||||||
|
# spec requires that this is consumed, but Channels does not. Any user
|
||||||
|
# consumer will override this one.
|
||||||
|
self.add_route(Route("websocket.connect", null_consumer))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def resolve_routing(cls, routing):
|
def resolve_routing(cls, routing):
|
||||||
|
@ -239,6 +243,12 @@ class Include(object):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def null_consumer(*args, **kwargs):
|
||||||
|
"""
|
||||||
|
Standard no-op consumer.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
# Lowercase standard to match urls.py
|
# Lowercase standard to match urls.py
|
||||||
route = Route
|
route = Route
|
||||||
route_class = RouteClass
|
route_class = RouteClass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user