Spawning python processes that create socketio clients from the server (Help with architecture) #1934
Replies: 2 comments 3 replies
-
In general yes, this seems like a good solution to me.
This is the one aspect of your solution that I feel is wrong. The Flask server should not own those other Python processes. The server may need to be upgraded and restarted, and that is no reason for those other processes to die. Also your Flask server may need to run multiple workers, which creates a complication if the server is the parent for those other processes (like which of the N workers is the parent?).
Socket.IO clients is a simple way to communicate, and you already have the server so it is convenient.
The deployment shouldn't be too difficult. You can use systemd to manage your processes (and drop the multiprocessing idea).
Not from the Socket.IO side. The message queue is used when you have auxiliary processes that emit to clients on behalf of the server. You don't have that, your auxiliary processes are clients, they can emit and also receive so you have a more robust solution that replaces the message queue with WebSocket.
They should be completely independent in my opinion. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your reply and for your work! The thing is that an external user will be the one that starts these processes from the GUI (Clicking start), that request is going to the Flask Server, so how would I start a process completely independent from Flask? Thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I'm working on a project that needs to implement quite a difficult architecture. I would really appreciate comments or some direction on how to do this in the best way.
General Idea:
My general approach:
Questions:
Beta Was this translation helpful? Give feedback.
All reactions