| ASP4 documentation | Contained in the ASP4 distribution. |
ASP4::Mock::Pool - Mimics the $r->pool APR::Pool object
my $pool = $r->pool;
$pool->cleanup_register( sub { ... }, \@args );
This package mimics the APR::Pool object obtained via $r->pool in a normal mod_perl2 environment.
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=ASP4 to submit bug reports.
Please visit the ASP4 homepage at http://0x31337.org/code/ to see examples of ASP4 in action.
| ASP4 documentation | Contained in the ASP4 distribution. |
package ASP4::Mock::Pool; use strict; use warnings 'all'; sub new { return bless { cleanup_handlers => [ ] }, shift } sub call_cleanup_handlers { my $s = shift; map { $_->( ) } @{ $s->{cleanup_handlers} } } sub cleanup_register { my ($s, $handler, $args) = @_; push @{ $s->{cleanup_handlers} }, sub { $handler->( $args ) }; } sub DESTROY { my $s = shift; undef(%$s); }# end DESTROY() 1;# return true: