channels: Recent version of channels doesn't support ASGI3
Since the recent version of daphne (2.3.0
) added support for ASGI3, I no longer can’t use channels (2.2.0
).
https://github.com/django/daphne/blob/master/daphne/cli.py#L30
Here it would likely to call channel’s router ( ProtocolTypeRouter) with additional two parameters (send
, receive
) which by now (https://github.com/django/channels/blob/2486738765064525cd8ee39294c44600140476ac/channels/routing.py#L56) is not supported.
Can we have support for ASGI3?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 8
- Comments: 15 (10 by maintainers)
N.B. you should be able to wrap Channels ASGI 2 apps with
asgiref.compatibility.guarantee_single_callable
- https://github.com/django/asgiref/blob/master/asgiref/compatibility.py#L39 - to convert it to ASGI 3.As for now, I just created subclass of
ProtocolTypeRouter
like below to support ASGI3.