On Tue, 17 Jun 2003 weigelt@metux.de wrote:
> On Tue, Jun 17, 2003 at 12:07:31PM +0530, A.Bhuvaneswaran wrote:
>
> <snip>
> > LISTEN/NOTIFY is yet another SQL. We can write a rule on an event and let
> > it notify. On the other hand, we can have a while(1) process which keeps
> > listening for that notification ie.. event. Once the event is occured, the
> > listening process would be notified. The listening process can be any
> > postgresql client including the one written in C, perl, php, etc.
> But the problem still is: how to receive the NOTIFY from an php script ?
> which function of the c-client lib can be used for this ?
If you're talking about a PHP script running under apache as a module or
CGI, then you probably can't (or if you can, you shouldn't due to time out
issues and such.)
Note that PHP really is a "real programming language", and if you write a
program to execute from the command line and detach it can run in the back
ground like any other language, even starting child processes and having
IPC and all that. Look up the "Process Control Functions" for more on
satrting child processes and all.
Note that the pcntl_* functions are not guaranteed to behave when run
under apache / as a CGI etc...