Re: Rethinking ASGI & Channels

2017-07-23 Thread Andrew Godwin
On Fri, Jul 21, 2017 at 4:10 AM, Tom Christie wrote: > Hi Andrew, > > Thanks for writing that up so comprehensively! > > Definitely in favor of moving to a server:consumer interface - as you say > that doesn't preclude over-the-network from being one of the possible > deployment styles. > > I lik

Re: Rethinking ASGI & Channels

2017-07-21 Thread Artem Malyshev
Hi Tom, I want to experiment with a uvicorn approach. I planning to do some after PoC of worker separation from channels. I will let you know if I have some questions. **Probably** Channels as a library will be a first user of the suggested interface of the uvicorn. Regards, Artem. On Fri, Jul 2

Re: Rethinking ASGI & Channels

2017-07-21 Thread Tom Christie
Hi Andrew, Thanks for writing that up so comprehensively! Definitely in favor of moving to a server:consumer interface - as you say that doesn't preclude over-the-network from being one of the possible deployment styles. I like your proposed approach to async vs sync variants of the interface.

Re: Rethinking ASGI & Channels

2017-07-13 Thread Artem Malyshev
You're absolutely correct! Single thread approach not gonna work. It will involve at least two threads to implement such kind of a worker. I don't wanna mix async layers with sync workers right now. This makes no sense to me because it still requires threading (asyncio.run_in_executor at least)

Re: Rethinking ASGI & Channels

2017-07-13 Thread Andrew Godwin
Well, in that case you'd have to invert the API to provide the channel layer with a callable for new messages and then run an event loop it controls, which is not going to work with async or most sync code. I think the best approach for something like that is putting the receive code in a separate

Re: Rethinking ASGI & Channels

2017-07-12 Thread Artem Malyshev
Hi, I know we discussed it in private. But I want to bring some ideas in public. During asgi_rabbitmq implementation I notice that channel workers are coupled to much to the polling of the channel layer. I want to try a different approach when layer can decide on its own when the message arriv

Rethinking ASGI & Channels

2017-07-12 Thread Andrew Godwin
Hi all, After recent threads on ASGI and similar problems ( https://groups.google.com/forum/#!topic/django-developers/_314PGl3Ao0), and my own introspection about where we are almost two years in, there are some changes I would like to make to the overall way ASGI/Channels works, both to make thin