1

I want to create deamon-like application that will have separated always running in background process and called every time from console process that will somehow pass requests to "deamon" process. The idea is that you can do something like ui.py create something and this ui.py will send its arguments to running and daemon it will perform requested action. After that ui.py will stop and deamon will continue running.

I was thinking about doing in throw network sockets or even http requests, but I hope to find more elegant solution. Maybe there is some way to establish Pipe or Queue connection every time.

P.S. It should be crossplatform.

  • Something like that: https://stackoverflow.com/questions/4163964/python-is-it-possible-to-attach-a-console-into-a-running-process ? – user966660 Apr 05 '18 at 19:03
  • From what I know, a socket server is the most simple solution, over that you have full control. – MegaIng Apr 05 '18 at 19:14
  • There are plenty of IPC/RPC solutions you can pick from in dependence of your needs - I'd recommend [ZeroMQ](http://zeromq.org/) if you really want to do something fancy with your daemon, including a complex multi-origin control over network and robust authentication. Even structures in the built-in [`multiprocessing.connection`](https://docs.python.org/2/library/multiprocessing.html#connection-objects) are more than enough for your use case. They all, more or less, use network sockets beneath all the convenience stuff, tho. – zwer Apr 05 '18 at 20:34

0 Answers0