Tim Bunce wrote:

> > Apache::Schedule let you register callbacks (per Apache child process)
> > that will be called after a given amount of time has passed, either once
> > or repeatedly. Callbacks will be called at the next request after the
> > required time, or at child exit time.
> 
> Would it work even if the server is not getting any requests?
> And if so, how?

No, that's the problem. :-)

That's where my idea of a cron job that does a HEAD request on an URL
that has the cleanup handler installed every 30 minutes (say) comes
from, so that there is a minimum level of service.

But while I would mention that in the README, that is outside the scope
of the perl module to do and left to the individual user. The
restriction would be clearly documented, and here's a way to help out
with it, but if it doesn't do what you want, don't use it (or tell us
how to improve it).

AOLserver has it easy, being in a single process and having this
scheduler tied in at the select() level, it never misses a beat and is
always on time (to a few tens or hundreds of milliseconds, if the server
is not overloaded). Apache is more complicated, with multiple child
processes that die after a while and don't know about each other (and
cannot depend on one particular child process to be there) and so on.

You could put something in the Apache parent process, but that would
require a new hook in Apache itself. That would be cool, but still not
free of problems:

 - the parent process often runs with root privileges, do we run the
scheduled callback as root inside the parent process?
 - if we do, if it is long running, you could have problems with Apache

Maybe it could register an URL to invoke on itself? Anyway, I'm not
enough into Apache to do something like *that*, even though I'd love
to...

-- 
"I've run DOOM more in the last few days than I have the last few
months. I just love debugging ;-)" -- Linus Torvalds

Reply via email to