[PHP] Use of callback on a stream

2008-03-28 Thread Olivier Dupuis
Hello, I am trying to make a daemon that launches shell commands via proc_open and gets the stdout of the command via a pipe. The thing is that I would like to get this stdout via a callback, instead of monitoring the pipe regularly. I tried the following code (this is a simplified version of

[PHP] Use of callback on a stream

2008-03-28 Thread Olivier Dupuis
Hello, I am trying to make a daemon that launches shell commands via proc_open and gets the stdout of the command via a pipe. The thing is that I would like to get this stdout via a callback, instead of monitoring the pipe regularly. I tried the following code (this is a simplified version of