O.P. PHP Signal handling
I'm experimenting with a PHP-based MSN bot. It runs a background CLI process that pretty much loops forever until it received a TERM signal from a bash script. Right now, the only way of inserting data into the process is for sending of messages. To do that, a file is created in a specific format and CHMODed to 666. The script picks it up on the loop cycle, processes and sends message, then moves file to a backup directory.
What I'm interested in, is if its possible to send raw data to such a running process and be able to process it (and send some back if possible too).
I'm looking at the pcntl_signal() function that registers a callback for when a specific signal is sent to the process (like TERM, which is already in the code), but I have no idea on how to send such a signal either from another PHP script. This function still doesn't take data, but I could at least tell it to go looking for data.
Any thoughts or other suggestions on how to do this?
I cannot hear you. There is a banana in my ear.
|