| Apache2-ASP documentation | Contained in the Apache2-ASP distribution. |
Apache2::ASP::Mock::Pool - Mimics the $r->pool APR::Pool object
my $pool = $Response->context->r->pool;
$pool->cleanup_register( sub { ... }, \@args );
This package mimics the APR::Pool object obtained via $r->pool in a normal mod_perl2 environment, and is used by Apace2::ASP::API.
Causes the subref to be executed with @args at the end of the current request.
It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.
Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.
John Drago <jdrago_999@yahoo.com>
Copyright 2008 John Drago. All rights reserved.
This software is Free software and is licensed under the same terms as perl itself.
| Apache2-ASP documentation | Contained in the Apache2-ASP distribution. |
package Apache2::ASP::Mock::Pool; use strict; use warnings 'all'; #============================================================================== sub new { return bless {_cleanup_handlers => [ ]}, shift; }# end new() #============================================================================== sub cleanup_register { my ($s, $ref, $args) = @_; push @{$s->{_cleanup_handlers}}, sub { $ref->( $args ) }; }# end cleanup_register() #============================================================================== sub call_cleanup_handlers { my $s = shift; map { $_->() } @{$s->{_cleanup_handlers}}; }# end call_cleanup_handlers() 1;# return true: