|
Apache::HeavyCGI::ExePlan - Creates an execution plan for Apache::HeavyCGI |
Apache::HeavyCGI::ExePlan - Creates an execution plan for Apache::HeavyCGI
use Apache::HeavyCGI::ExePlan;
my $plan = Apache::HeavyCGI::ExePlan->new(
METHODS => ["header", "parameter"],
CLASSES => ["my_application::foo", "my_application::bar", ... ],
DEBUG => 1,
WALKTYPE => "m",
WATCHVARIABLE => "SOME VARIABLE",
$plan->walk;
When an execution plan object is instantiated, it immediately visits all specified classes, collects the singleton objects for these classes, and checks if the classes define the specified methods. It creates an array of objects and methods or an array of code references.
The walk method walks through the execution plan in the stored order and sends each singleton object the appropriate method and passes the application object as the first argument.
Normally, every application has its own execution plan. If the execution plan is calculated at load time of the application class, all objects of this class can share a common execution plan, thus speeding up the requests. Consequently it is recommended to have an initialization in all applications that instantiates an execution plan and passes it to all application objects in the constructor.
walk() is called. Defaults to
[qw(header parameter)]
walk() is called. Has no default.
undef. By setting
WATCHVARIABLE you can watch a member variable of the Apache::HeavyCGI
object on entering/exiting each call to each class/method pair. Only
changes of the variable trigger a warning.
m (default) or f. If set to m, all
method calls issued by the call to walk() are execute as method calls.
If set to f, all method calls are replaced by their equivalent
subroutine calls, bypassing perl's method dispatch algorithm. The
latter is recommended on the production server, the former is
recommended in the development environment. m allows you to use the
Apache::StatINC module with the effect it usually has. Using
Apache::StatINC with WALKTYPE=f has no effect, as all subroutines
are preserved when Apache::StatINC reloads a file, so the execution
plan will not note the change.
|
Apache::HeavyCGI::ExePlan - Creates an execution plan for Apache::HeavyCGI |