[Catalyst] Catalyst and modperl

Matt S Trout catalyst at trout.me.uk
Mon Aug 1 15:46:08 CEST 2005


On Mon, Aug 01, 2005 at 10:21:01AM +0100, Toby Corkindale wrote:
> On Sat, Jul 30, 2005 at 01:10:28AM -0400, Andy Grundman wrote:
> > Thomas L. Shinnick wrote:
> > >I remember hearing something worrisome, and now I don't remember and can't 
> > >find _where_ it was mentioned.
> > >
> > >Is it true that, currently, you can't have more than one Catalyst-based 
> > >application running under modperl?  Something to do with class data?  Is 
> > >this the reason that Sebastian has been working on moving class data 
> > >(Catalyst::Engine, etc.) into instances?  Or has my brain had a forgotten 
> > >tryst with a hard surface?
> > 
> > I believe the only issue is that you cannot run more than one instance 
> > of a single Cat app under the same mod_perl server.
> 
> Actually, we have multiple instances of the same Catalyst app running on the
> same server here. It's done by using the multiple-mod_perl-instances option on
> Apache, which does double the memory usage, unfortunately.

I think you can maybe get round this via

package MyApp::Wrapper1

sub handler {
  local *MyApp::config;
  <mess with the config here>
  MyApp->handler(@_[1..$#_]);
}

though you'll probably need to local-ise and fiddle with more than that.

However, end of request the local aliases will fall off the symbol table
(since they're bound to the call stack frame, effectively) thus leaving
everything clean for nother WrapperX module to do the same thing on the
next request.

For those of you who've done lisp, this was somewhat inspired by the
dynamic-wind construct.

-- 
     Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.



More information about the Catalyst mailing list