W
W
wawa2018-10-05 13:09:06
Django
wawa, 2018-10-05 13:09:06

How does Django channels work?

Understanding channels.
I am reading the official tutorial https://channels.readthedocs.io/en/latest/tutorial...
As I understand it, one Consumer instance runs in its own process/worker and serves one client throughout the connection time.
Those. 1 process == 1 Consumer() == 1 Connection == 1 client.
If so, then if I create 10 workers (it is assumed that there should not be many of them, as I understand it), then only 10 people will be able to use the chat at the same time.
Well then, the price of all this technology is worthless.
Obviously I'm wrong about something.
What am I missing?
In the documentation of the channels, the context of the operation of this entire system is omitted (or smeared throughout the dock). I mean OS context. Can you explain how it works in terms of entities like socket, connection, epool, process, thread, RAM? I will be very grateful.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2018-10-05
@sergey-gornostaev

Does Django Channels solve the problem with blocking requests?

R
Roman Kitaev, 2018-10-05
@deliro

Well then, the price of all this technology is worthless.

Oh, sorry, we're closing the project.
What makes you think that there is one consumer for each process? A consumer instance is created for each connection, yes. Yes, it lives all the time while the connection is maintained. But 1 worker can support thousands of such connections. How - read about asyncio or sources of channels.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question