perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [patch] default request pool sub
Date Tue, 29 Jan 2002 16:17:33 GMT
Doug MacEachern wrote:

> On Tue, 29 Jan 2002, Stas Bekman wrote:
> 
> 
>>I'm not sure if I've picked the best name, but I need this wrapper for 
>>compat. If I have it I don't need to prototype functions required to 
>>provide the pool argument as p=SOME_DEFAULT, but just p,
>>
>>So now in compat.pm we can write wrappers:
>>
>>my $req_pool = APR::Pool::from_current_request();
>>APR::Foo::bar($req_pool, ...)
>>
> 
> APR:: functions should not default any APR::Pool argument, only
> Apache:: compat wrappers.


Yes, sorry, talking about compat wrappers only.

> in which case the wrappers should just use
> Apache->request->pool;  or if the function is really needed (like to
> fallback on pconf if there is no Apache->request), it should be a
> ModPerl::Util:: function.  nothing in APR::*.xs should reference modperl_
> symbols, so they can be used outside of mod_perl.

Sure, be it ModPerl::Util:: function. How should it be called? Can I use 
the same code I've used for APR::Pool::from_current_request() in my orig 
post.

Take the case of the Apache::Util::ht_time wrapper. We cannot use 
Apache->request->pool without fallback, since we don't know where it's 
used. So I prefer to have one function that returns some pool for sure 
to be used in all wrappers needing this functionality. Rather than 
trying Apache->request->pool and falling back to pconf in every compat 
wrapper we need a poll.

So if the function ModPerl::Util::from_current_request() is cool with 
you, what should be the best name?

We will also document that this function is deprecated and used only in 
the compat wrappers.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message