channels - async consumer behind sync middleware

21 views
Skip to first unread message

Özgür Akçalı

unread,
Nov 4, 2020, 1:08:54 PM11/4/20
to Django users
I am using async consumers, and everything they do is async, except for a middleware. I have a custom authentication middleware that connects to the database and runs 2-3 queries. 

It is suggested in the docs that if anything non-async is done in the consumer, we should use sync consumers. Same principle applies here, or is it ok to do sync stuff in a middleware as it is done only on session initializaiton?
Reply all
Reply to author
Forward
0 new messages