Interprocess communication
Posted: Tue Nov 09, 2004 2:59 am
I'm experimenting with an IRC bot in PHP, and I have some functionality that I'd like to add to it to do things like monitor stuff on my Linux system, and I don't think I want the bot code and the monitoring code running in the same process, so.. what suggestions can I get for ways that two PHP applications running on the same system can communicate?
What I want to achieve is have the bot running as one process, and the monitoring system running as another. Whenever it needs to, the monitoring process will send a message (somehow) to the IRC bot process with a message that should be output.
The box this is running on isn't dedicated to this task, and is running a few sites with apache.
I was looking at webservices, but the problem with that is that the as far as I can tell with using libs like NuSOUP, the server has to be a complete standalone script, and the structure I'm going to have in the bot is a loop constantly checking for data, like:
while (true) {
if (theres data on the IRC socket)
read it and respond to it
** if (data from some other source, e.g. monitoring process)
read it and respond to it
}
So webservices still leaves the problem of how to inject the info. from the webservices server into the point marked ** in the bot's data reading loop.
Any input appreciated.
What I want to achieve is have the bot running as one process, and the monitoring system running as another. Whenever it needs to, the monitoring process will send a message (somehow) to the IRC bot process with a message that should be output.
The box this is running on isn't dedicated to this task, and is running a few sites with apache.
I was looking at webservices, but the problem with that is that the as far as I can tell with using libs like NuSOUP, the server has to be a complete standalone script, and the structure I'm going to have in the bot is a loop constantly checking for data, like:
while (true) {
if (theres data on the IRC socket)
read it and respond to it
** if (data from some other source, e.g. monitoring process)
read it and respond to it
}
So webservices still leaves the problem of how to inject the info. from the webservices server into the point marked ** in the bot's data reading loop.
Any input appreciated.