Matt Sergeant wrote:

> > Isn't forking off from Apache rather nasty? I saw something to that
> > effect somewhere in the eagle book and on some web pages, but I think
> > there are ways to do that without causing problems.
> 
> Yes, its a pain. I suggest using the ways detailed below. My only problem
> with those ways is that its not controlled from your application
> generally, unless you write your own cron-a-like in Perl, and access your
> datastore to get the configuration.

Well, if I call the "check for things to do" URI every minute, then I'll
be just fine. Many times, I'll just check and find nothing to do, but
it'll be under "enough" application control. You might contrieve adding
a cron entry as being "outside the application" though...

I would really like putting this in a cleanup handler, but the problem I
see is if I don't get any hit for too long (which might happen for an
internal web site, say over the weekend), I might miss events. I'll
probably have a combination of both approaches...

> > I am on a Unix-like system, but I wanted the events to be updated by the
> > web server itself, so that I could use the Apache::DBI cached connection
> > to the DBMS (I want to store the events in there).
> 
> The cached connection will be used, just as it would for the rest of your
> application. Also note that HTTP::GHTTP loads a *lot* faster than LWP, and
> executes faster too. And yes, you can restrict that URL to localhost, or
> password protected.

I was thinking of using wget with "-O /dev/null". :-)

As for the cached database connection, I knew about that, but I was
thinking of the forking approach (where there was no cached connection
available (not that it couldn't be cached!)).

-- 
Pierre Phaneuf
http://www3.sympatico.ca/pphaneuf/

Reply via email to