Re: [mp2] reliable methods to prevent handlers from repeating

[prev] [thread] [next] [Date index for 2005/01/20]

From: Geoffrey Young
Subject: Re: [mp2] reliable methods to prevent handlers from repeating
Date: 22:00 on 20 Jan 2005

> what technique would you use if you had to have a handler work
> exactly once, even though it may never be invoked as an initial
> request?

if you're in prefork, off the top of my head I might set a perl global and
then reset it using a cleanup handler.  something like

$My::Foo::seen++;
$r->register_cleanup(sub { undef $My::Foo::seen });

so, again in prefork only, at the start of any request $My::Foo::seen should
be false.  all bets are off if you're using threads.

--Geoff

Re: [mp2] reliable methods to prevent handlers from repeating
Geoffrey Young 22:00 on 20 Jan 2005

Re: [mp2] reliable methods to prevent handlers from repeating
Philippe M. Chiasson 22:32 on 20 Jan 2005

Generated at 17:42 on 27 Jan 2005 by mariachi v0.52