Andrew Godwin

Results 206 comments of Andrew Godwin

OK, then it's not `asgiref`, which is both good and bad. Have you added logging to the stub `get_user` to see if it's getting called at all? Given you have...

So, I've replicated this enough to work out it's a side effect specific to `channels_redis`. If I replace the broadcast mechanism with something else, it functions fine.

OK, so in my digging, this looks like it's related to the `channels_redis` mechanism which tries to share connections across coroutines in the same process. That code wasn't super amazing...

Yup, I cloned the demo repo above and set it up and it fails consistently.

That channel layer also uses a very complicated asyncio-based setup to share connections from a single process. Ideally `asgiref` would not disrupt whatever mechanism they're both using to work, but...

Ah yes, excellent point. They are _mostly_ drop-in for `threading.Local`, but it is likely wise to explain the differences.

Basically, anywhere you would write: ``` from threading import Local ``` you can instead write ``` from asgiref.local import Local ``` and it will work the same, with the same...

Well, the first problem I see is that you have `self.send` not `await self.send`, so definitely fix that. Without awaiting it, you might not ever give the other coroutine a...

In that case, I need actual code that breaks so I can try to look at it and potentially reproduce it!

It is possible it is related to https://github.com/django/channels_redis/issues/79, but since neither this or that have steps to reproduce or detailed error info, I can't be sure yet.