Connect two daemons in python

What is the best way to connect two daemons in Python?

I have a daemon A and B. I would like to receive the data generated by B in module A (possibly bi-directional). Both daemons support plugins, so I would like to close the connection in the plugins. What is the best and cross-platform way to do this?

I know several mechanisms from low-level solutions - shared memory (C / C ++), linux pipe, sockets (TCP / UDP), etc. and several high-level queues (JMS, Rabbit), RPC.

Both daemons should work on the same host, but obviously the best approach is to ignore the type of connection.

What are typical solutions / libraries in python? I am looking for an elegant and easy solution. I do not need an external server, only two processes talk to each other.

What should i use in python for this?

+5
source share
2 answers
+2
source

I'm not sure how heavy your traffic is, but I would recommend asyncore . Its quite easy to use and it is based on sockets.

I made a template command with this a long time ago. I can dig out the code if you are interested.

0
source

All Articles