[Catalyst] Method to overload per request

Matt S Trout dbix-class at trout.me.uk
Sat Aug 11 03:09:23 GMT 2007


On Thu, Aug 09, 2007 at 02:28:52PM -0400, John Lifsey - Contractor - wrote:
> 
> Dylan Vanderhoof wrote:
> 
> >>
> >>Is there a method in C::Req (or any other part of Cat) that I can 
> >>overload which is called only once per request? I thought 
> >>that would be 
> >>prepare, but it seems that is called several times per page load. Any 
> >>advice appreciated.
> >>
> >>John
> >>
> >
> >MyApp::Controller::Root->auto?
> >
> >-Dylan
> 
> That would be fine on a per controller basis, but this is in a plugin 
> and should apply for any request to any controller.

prepare should normally only be called once per request cycle.

If you aren't trying to interrupt the request cycle, it shouldn't be a
plugin.

I suggest you should start a new thread explaining what you're actually
trying to achieve; my current thought is 95% probability your design is
wrong, based on previous experience of clients saying the same things to me.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/                    http://www.shadowcat.co.uk/ 



More information about the Catalyst mailing list