[Catalyst] NEXT vs SUPER in the catalyst handle_request cycle

J. Shirley jshirley at gmail.com
Mon Nov 20 22:04:26 GMT 2006


Take a look at Class::C3 and next::method, much faster than using NEXT
and you still get the benefits.

-J

On 11/20/06, Michael Reece <mreece at vinq.com> wrote:
> i am overriding a handful of catalyst methods so that i can inject
> some custom debugging/timing code into the request cycle.
>
> in MyApp.pm, i have methods
>
>         handle_request
>         prepare
>         dispatch
>         forward
>         finalize
>
> that each do their thing and then return $c->NEXT::foo(@_) or $c-
>  >SUPER::foo(@_), but i am having a difficult time telling when i
> should use SUPER and when i should use NEXT.
>
> recent benchmarks pointing to the slowness of NEXT (plus the
> annoyances caused by stepping into a NEXT call in the debugger) has
> led me to use SUPER instead where it seems safe, and trial and error
> has led to apparently needing NEXT for finalize, while SUPER works
> for the others, but i am not convinced it is Right.
>
> could/should i just call NEXT for all of them?  or is NEXT only
> appropriate for certain overrides?  is there an easy way to determine
> when to use one versus the other?
>
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>



More information about the Catalyst mailing list