Cees Hek <suppressed> wrote:
> Quoting Brian Cassidy <suppressed>:
>
> - you have effectively hijacked the prerun and postrun methods which means they
> are unavailable to any sub/super classes. This brings me back to my request
> from many months ago for the ability to register prerun and postrun hooks so
> that you can have multiple prerun/postrun execution points (patch available
> here:
> http://cees.crtconsulting.ca/perl/patches/CGI-Application-3.21.callbacks.patch)
> . As an interim solution you may want to include a comment in your docs that
> lets people know they need to add $self->SUPER::cgiapp_postrun to their own
> custom cgiapp_postrun method if they use it (same for cgiapp_prerun). Otherwise
> your cache code stops working.
Cees,
Here's some more feedback on your patch. First, it would be great if it
was extended with some POD.
To help myself and others further consider it, it would be great to see
a couple of examples of the new syntax in use, especially if it could be
contrasted the syntax needed without the patch.
I also have some more technical feedback:
I thought it was curious that 'setup' was left out of the list of valid
hooks.
Also, "Positions", as implemented, don't seem as useful as they could
me. If I register a hook as REALLY_FIRST for teardown(), I would expect
it would run first thing after teardown was called().
As you've implemented it, the REALLY_FIRST teardown() position would
happen /after/ teardown is called.
The way I think about it, most of the time one "position" would do--
just declaring what stage you want something to run it should be good
enough.
For some special cases, I could imagine that you have something you want
to run "really first" (or last). at a particular stage. For example,
perhaps you want to cache a page after all other output filters have
been applied.
The trouble is, what happens when you load the next plug-in that wants
to run "really last" at the same stage? They both can't be "really
last".
My inclination would be to initially leave "Positions" out of the patch
and try it out with simple stage registration.
Besides, if you want something to run "really last", you can easily
force that with a sub-class for many cases:
sub teardown {
# Hope I get this syntax right.
SUPER::teardown(@_);
my $self = shift;
# do my 'really last' thing here.
}
Mark
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.