On Fri, Jul 21, 2017 at 4:10 AM, Tom Christie <christie....@gmail.com> 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 like your proposed approach to async vs sync variants of the interface. > > The callable returning a callable is a neat way around too, although I > can't immediately figure out how eg. middleware looks against that pattern. > Middleware on a consumer pattern is naturally harder because you have to capture sends, but it would be possible - just not as neat as single-call functions. You'd need a wrapper base class and a wrapper second-level callable. > > Also does the interface look the same for worker:consumer? ie. Is it > expected that `send()` could either be direct to server, or over a channel > layer, with the client being agnostic as to which of those two cases will > be used, or is the client expected to use the channel layer in that case? > Better names pending, the "send" argument to the callable only sends stuff back down the socket, while to send across the channel layer (to e.g. another socket-consumer or to a worker) you'd use "channel_layer.send". As I said, better names needed. Might just call the first "socket_reply" or something very explicit. Glad you like the proposal overall though. I'm taking a couple weeks off and having a proper holiday in New Zealand, and then get immediately thrust into PyCon AU and DjangoCon US, but I'll probably coordinate with Artem and start work on a branch to implement this when I get back. Andrew -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1uo%3DwSwFydyovezFceqgwPW7RJLpRvJnGJHY20O45XvSBQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.