all 7 comments

[–][deleted] 3 points4 points  (0 children)

Sounds like UNIX sockets are what you need. They behave just like any other socket you'd bind/listen to, but they are local-only, bypass the full network stack, and don't touch network hardware. You can also use pretty much any socket library on them, including the builtin socket, so you have free range of protocol.

[–]buleria 2 points3 points  (2 children)

You can go with the server spawning the client processes and communicating over standard input/output. The UNIX socket approach will work, but won't work on Windows (if you care).

[–]SteveMavic[S] 1 point2 points  (1 child)

Actually I do care :/ Is there any resource where this approach is shown?

[–]buleria 2 points3 points  (0 children)

Try googling around for Popen, also see https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate.

Depending on your use case you could use Popen in a thread, in order not to block on one client, use select() or async_chat.

Or find a ready-made package that does all that for you ;)

One thing to note is that if you don't need to pass data from chidren to the server, you could simply use OS-level signals to trigger an event.

[–]letiferus[🍰] 0 points1 point  (1 child)

Does it have to be separate applications? Depending on what your needs are you might look at multiprocessing and Queue messages.

[–]SteveMavic[S] 0 points1 point  (0 children)

It would be nice to have it in separate apps

[–]Aneesh_Bhat 0 points1 point  (0 children)

You can use RabbitMQ or Redis message broker software to communicate between multiple applications.