httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Morris <supp...@bettercgi.com>
Subject Re: hook for timer based call?
Date Thu, 18 Sep 2008 01:04:58 GMT
> Is there a mechanism to have apache call my module 
> on a regular basis, like a hook that is called by 
> a timer?  The only other thing I can think of
> is to spawn my own thread that stays alive and 
> does this.

   Is the exact timing crucial, or does it just 
need to be done "every so often".  When I need to 
do something regularly, but exact timing isn't 
crucial, I'll use one of three strategies:

a) do it every X number of requests

b) check the time every X requests and see 
   if it's time to do it.

c) on each request, call rand() such that there 
   is a one in X chance of doing it now.
--
Ray B. Morris
support@bettercgi.com


On 09/17/2008 07:35:49 PM, Chuck Stein wrote:
> Greetings,
> I would like my module to do some housekeeping on a regular basis.  
> Is
> 
> there a mechanism to have apache call my module on a regular basis,
> like 
> a hook that is called by a timer?  The only other thing I can think 
> of
> 
> is to spawn my own thread that stays alive and does this.
> 
> Thanks,
> Chuck
> 
> 



Mime
View raw message