Ah, I see, you are assuming sticky sockets. That makes things a lot easier to architecture, but a whole lot harder to load-balance (you have to get your load-balancer to deliberately close sockets when a server is overloaded as many will not go away by themselves).
Still, it makes scaling down a lot easier, so it's nicer to program against in that sense. Goes against the way most Python web code is written though (imagine if you had to use sticky sessions for HTTP clients so they always hit the same server!). I wonder if there is a way of doing something like this well, so that it's easy to write but also lets you scale later. Andrew On Wed, Jun 14, 2017 at 9:53 PM, Tom Christie <[email protected]> wrote: > > I note that your examples do not include "receiving messages from a > WebSocket and sending replies" - I would love to see how you propose to > tackle this given your current API, and I think it's the missing piece of > what I understand. > > I've just added an `echo` WebSocket example. > > I've also now added support for broadcast, currently implemented using > Redis Pub/Sub. > There's a full example for a chat server that can be properly distributed. > (*) > > Aside: Right now that *happens* to be implemented as middleware, but > there's no reason it couldn't equally well be integrated at the server > level, so not a detail to get sidetracked by. More important is how the > application interface for it looks. > > (*) Yes, you'd have sticky WebSockets. > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > 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/2da48b17-b47f-42e3-b1bb- > 4a0e5a9b5709%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/2da48b17-b47f-42e3-b1bb-4a0e5a9b5709%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAFwN1upPew20giEHu%3D3NCtUD9e2WqHvcvNBsaVQg1nySm%3D232Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
