Discussion:
Channels: event loop and thread
Zhiyu (Drew) Li
2018-11-06 12:41:15 UTC
Permalink
Hi there,

I got the following 2 questions

There is only one thread (MainThread) and one event loop running on it by
default if all existing consumers are asynchronous consumers?

Regular sync views (if any) are handled by Threadpoolexecutor and run in a
sub Thread. These sync views won't block the event loop in the main thread.
Channels takes care of this subthread and I don't need to explicitly manage
it. Right?

Thanks
Drew
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMmsbUkjbuRvYjoZDyDY%3DXkaoQJHHiG659XKX-tPCbe7HqgivA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Godwin
2018-11-06 16:47:54 UTC
Permalink
Your assumptions are correct. The only extra thing to be aware of is that
some Django interactions (like the Channels Auth middleware) need to do
database connections and thus have to launch into a subthread for that, but
that's also managed.

Andrew
Post by Zhiyu (Drew) Li
Hi there,
I got the following 2 questions
There is only one thread (MainThread) and one event loop running on it by
default if all existing consumers are asynchronous consumers?
Regular sync views (if any) are handled by Threadpoolexecutor and run in a
sub Thread. These sync views won't block the event loop in the main thread.
Channels takes care of this subthread and I don't need to explicitly manage
it. Right?
Thanks
Drew
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAMmsbUkjbuRvYjoZDyDY%3DXkaoQJHHiG659XKX-tPCbe7HqgivA%40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CAMmsbUkjbuRvYjoZDyDY%3DXkaoQJHHiG659XKX-tPCbe7HqgivA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFwN1urN2bWHedWU1YfpXYmGiZ8z%2BAdE4PUX_sitTtD6-EriVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...