Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

88 lines (61 sloc) 2.137 kB
package POE::Resources;
use strict;
use vars qw($VERSION);
$VERSION = '1.288'; # NOTE - Should be #.### (three decimal places)
my @resources = qw(
POE::XS::Resource::Aliases
POE::XS::Resource::Events
POE::XS::Resource::Extrefs
POE::XS::Resource::FileHandles
POE::XS::Resource::SIDs
POE::XS::Resource::Sessions
POE::XS::Resource::Signals
POE::XS::Resource::Statistics
);
sub load {
my $package = (caller())[0];
foreach my $resource (@resources) {
eval "package $package; use $resource";
if ($@) {
# Retry the resource, removing XS:: if it couldn't be loaded.
# If there's no XS:: to be removed, fall through and die.
redo if $@ =~ /Can't locate.*?in \@INC/ and $resource =~ s/::XS::/::/;
die;
}
}
}
1;
__END__
=head1 NAME
POE::Resources - loader of POE resources
=head1 SYNOPSIS
# Intended for internal use by POE::Kernel.
use POE::Resources;
POE::Resources->load();
=head1 DESCRIPTION
POE::Kernel is internally split into different resources that are
separately managed by individual mix-in classes.
POE::Resources is designed as a high-level macro manager for
POE::Resource classes. Currently it implements a single method,
load(), which loads all the POE::Resource classes.
=head1 METHODS
POE::Resources has a public interface, but it is intended to be used
internally by POE::Kernel. Application programmers should never need
to use POE::Resources directly.
=head2 load
POE::Kernel calls load() to loads all the known POE::Resource modules.
Each resource may be handled by a pure perl module, or by an XS
module. For each resource class, load() first tires to load the
L<POE::XS::Resource::...> version of the module. If that fails,
load() falls back to C<POE::Resource::...>.
=head1 SEE ALSO
See L<POE::Kernel/Resources> for for public information about POE
resources.
See L<POE::Resource> for general discussion about resources and the
classes that manage them.
=head1 AUTHORS & LICENSING
Please see L<POE> for more information about its authors,
contributors, and POE's licensing.
=cut
# rocco // vim: ts=2 sw=2 expandtab
# TODO - Edit.
Jump to Line
Something went wrong with that request. Please try again.