0

I have a gevent-socketio server program (similar to the simple-chat-example) running. There is a second python script on the same machine, which does motion detection and also runs endlessly. I want to let them both talk to each other and in some cases the gevent-socketio server will trigger events for his client upon recieving a message from the motion-detection.

The machine is a RasperryPi, running Raspian Linux and I'm using python 2.7 (v3 is also available).

  1. How would I connect the two scripts, so they can send messages to each other?
  2. Is the answer in this SO Question the way to go?
  3. Does this zmq work with multiple programs or is it only for multiple threads in single program?
  4. In general, what is the "best" solution, when both scripts run on the same machine (considering the fact that gevent is already used in both programs)?
Community
  • 1
  • 1
dube
  • 4,898
  • 2
  • 23
  • 41
  • 2
    1. write/read from a shared file. 2. use raw sockets 3. make one (or both) accept http calls 4. use a message queue like zeromq 5. have them share memory – RickyA Mar 18 '15 at 23:47
  • read this: http://en.wikipedia.org/wiki/Inter-process_communication – RickyA Mar 18 '15 at 23:48
  • @RickyA thanks, I know that there are many options. What I wonder is what is a straightforward solution when the programs are already using gevent and gevent-socketio and will reuse some of the motion events and trigger events to listening clients (over socketio). Since you mentioned zeromq I assume gevent-zeromq integration would make sense then (the one that also is mentioned in the linked question). However, I seldomly find statements on wether the techniques work over program borders or between threads of a single program. – dube Mar 19 '15 at 09:35
  • I updated the question, I hope that makes it more clear what my concerns are (no doubt I could come up with "a solution" without help, but I would like it to be "not stupid") – dube Mar 19 '15 at 09:45

0 Answers0