Since Django 3.0 supports ASGI out of the box, this library doesn't necessarily need to rely on Django Channels as a dependency for newer Django projects. Instead, we could create a custom ASGI application, and use it to handle GraphQL websocket connections.
We would still need a pub/sub layer, but could use aioredis directly. This would make the code much easier to understand, since sending data to the client and responding to pub/sub events could be decoupled.
Since Django 3.0 supports ASGI out of the box, this library doesn't necessarily need to rely on Django Channels as a dependency for newer Django projects. Instead, we could create a custom ASGI application, and use it to handle GraphQL websocket connections.
We would still need a pub/sub layer, but could use
aioredis
directly. This would make the code much easier to understand, since sending data to the client and responding to pub/sub events could be decoupled.Some thoughts on implementing a custom websocket ASGI app for Django: https://jaydenwindle.com/writing/django-websockets-zero-dependencies/