Apache2::ASP::Mock::Pool - Mimics the $r->pool APR::Pool object


Apache2-ASP documentation Contained in the Apache2-ASP distribution.

Index


Code Index:

NAME

Top

Apache2::ASP::Mock::Pool - Mimics the $r->pool APR::Pool object

SYNOPSIS

Top

  my $pool = $Response->context->r->pool;
  $pool->cleanup_register( sub { ... }, \@args );

DESCRIPTION

Top

This package mimics the APR::Pool object obtained via $r->pool in a normal mod_perl2 environment, and is used by Apace2::ASP::API.

PUBLIC METHODS

Top

cleanup_register( sub { ... }, \@args )

Causes the subref to be executed with @args at the end of the current request.

BUGS

Top

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.

HOMEPAGE

Top

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

AUTHOR

Top

John Drago <jdrago_999@yahoo.com>

COPYRIGHT

Top

LICENSE

Top

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: