I guess I could have a service running that listens for a 'start'
command, and launch phirehose from that.
I don't need the actual service to start/stop via browser interface, I
just need it to start/stop collecting.
On Aug 14, 9:20 pm, Fenn Bailey <
fenn.bai...@gmail.com> wrote:
> Hey MrGlass,
>
> Telling it when to stop should be fairly easy. You could just put a check in
> your implementation of checkFilterPredicates() that checks a common flag
> (say in a database or memcache) that tells it to keep running or not, ie,
> something like:
> ---
>
> if ($this->getKeepRunning() != TRUE) {
> $this->disconnect();
> exit;
>
> }
>
> ---
>
> Where getKeepRunning() is some sort of (fast) check to see if the "keep
> running" flag is set. Keep in mind that checkFilterPredicates() is called
> every 5 seconds, so you want your check to be quick.
>
> In terms of starting the server, that's actually harder than it may
> initially appear. Keep in mind (as per the documentation) that Phirehose is
> *not* designed to be run from inside a webserver (I'm not sure if you were
> intending to or not).
>
> If you just start Phirehose from an AJAX request, it will only run until you
> hit PHP's maximum run time (usually only a 1-2 minutes) and then stop. To
> keep it running forever (ie: in an infinite loop), you need to run it as a
> separate, backgrounded process.
>
> You can read some more about this in an previous discussion here:
>
>
http://groups.google.com/group/phirehose-users/browse_thread/thread/c...
>
> Cheers!
>
> Fenn.