Answer the question
In order to leave comments, you need to log in
How to manage a running Python process? Is there something like an API for running processes?
I welcome everyone. The bottom line is this, there is a Python script, quite heavy, it runs for more than 2 seconds, it takes more than 500 MB of RAM. It opens the browser in the background and does many other things, which is why it's so slow, but not the point.
And in order not to run it every time and not wait until it boots up and is ready to go, I keep it running all the time, and I feed it tasks through the file system, that is, if changes occur in a certain folder, then it processes the task and then hangs in mind.
But I invented this system myself, and I assume that there is some more reliable and faster way to communicate with the running script (it turns out this is essentially a Python daemon).
If there is such a mechanism, please tell the wretched man what it is called and what to google at least. Thanks in advance for your time. You can also do the same in PHP, if there suddenly is a suitable solution.
Answer the question
In order to leave comments, you need to log in
Manage via signals, sockets, API It is
possible through the file system.
A socket is a programming interface for providing information exchange between processes. Probably, this is what we are talking about.
https://habr.com/en/post/149077/
Pipes, signals, sockets, shared memory, threads. Google on IPC - InterProcess Communication
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question