Documentation for Django 3.1 says this about async views:
The main benefits are the ability to service hundreds of connections without using Python threads. This allows you to use slow streaming, long-polling, and other exciting response types.
I believe this means we could implement an SSE (Server-Sent Events) view without monopolizing a thread per client, but I didn't figure out exactly how.
I know about Django Channels, but I'm curious to see if we can avoid it.
I initially thought StreamingHttpResponse was the way to go since it has been used successfully to implement SSE with synchronous views. Still, I would accept any solution based on asynchronous views.
I opened a bounty on stack-overflow, but so far, no viable solution was proposed.
Does anyone know how we could leverage async views to implement SSE?
Best regards,
Benoit Blanchon