Re: Django channels communication not asynchronous

2018-12-28 Thread Andrew Godwin
Channels request/response cycles must be natively non-blocking all the way from the application code up through the server. If you even so much as slightly block you're going to disrupt everything and maybe deadlock it, which is why you need to be careful about when you call synchronous things.

Re: Django channels communication not asynchronous

2018-12-24 Thread Akshay Surya
Sorry for that Actually in my code I did use await before send, but somehow got deleted when I posted here... I would try debugging it but I am having a doubt that it's because django is inherently event driven... Is there something like a request response cycle should be synchronous that

Re: Django channels communication not asynchronous

2018-12-24 Thread Andrew Godwin
You appear to have missed an "await" before "self.send" - could that be the cause? In general, the best thing to do if things seem to "block" is to set the environment variable PYTHONASYNCIODEBUG=1 and Python will warn you if anything blocks for too long and seems synchronous. Andrew On Mon,

Fwd: Django channels communication not asynchronous

2018-12-24 Thread Akshay Surya
Hi everybody, I wrote django channels code to send api data from two different sources asynchronously through webscokets. The different sources takes few seconds to 1 minute to compute and send back the data. I managed to call them asynchronously using asyncio event loop. But the issue is that