python - ZeroMQ bidirectional async communication with subprocesses -


i have server process receives requests web clients. server has call external worker process ( .py ) streams data server , server streams client.

the server has monitor these worker processes , send messages them ( kill them or send messages control kind of data gets streamed ). these messages asynchronous ( e.g. depend on web client )

i thought in using zeromq sockets on ipc://-transport-class , call socket.recv() method blocking.

should use 2 sockets ( 1 streaming data server , receive control messages server )?

using separate socket signalling , messaging better

while poller-instance bit, cardinal step use separate socket signalling , 1 data-streaming. always. point is, in such setup, both poller.poll() , event-loop can remain socket-specific , spent not more predefined amount of time, during real-time controlled code-execution.

so, not hesitate setup bit richer signalling/messaging infrastructure environment enjoy increased simplicity of control, separation of concerns , clarity of intents.

zeromq excellent tool doing - including per-socket io-thread affinity, indeed fine-grain performance tuning available @ fingertips.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -