On Fri, Nov 3, 2017 at 5:54 AM, Israel Brewster <isr...@ravnalaska.net> wrote:
> I have a Flask/UWSGI web app that serves up web socket connections. When a 
> web socket connection is created, I want to store a reference to said web 
> socket so I can do things like write messages to every connected 
> socket/disconnect various sockets/etc. UWSGI, however, launches multiple 
> child processes which handle incoming connections, so the data structure that 
> stores the socket connections needs to be shared across all said processes. 
> How can I do this?
>

You're basically going to need to have a single process that manages
all the socket connections. Do you actually NEED multiple processes to
do your work? If you can do it with multiple threads in a single
process, you'll be able to share your socket info easily. Otherwise,
you could have one process dedicated to managing the websockets, and
all the others message that process saying "please send this to all
processes".

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to