31 Aug 2009 09:38:39 UTC
- Distribution: POE-Component-ResourcePool
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (281 / 514 / 0)
- KwaliteeBus factor: 2
- 50.00% Coverage
- License: unknown
- Activity24 month
- Download (14.1KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionNUFFIN יובל קוג'מן (Yuval Kogman)
Take me over?The maintainer of this distribution is looking for someone to take over! If you're interested then please contact them via email.
POE::Component::ResourcePool::Resource::TryList - Delegate to a number of resources.
use POE::Component::ResourcePool::Resource::TryList; my $good = POE::Component::ResourcePool::Resource::Good->new( ... ); my $better = POE::Component::ResourcePool::Resource::Better->new( ... ); my $best = POE::Component::ResourcePool::Resource::TryList->new( resources => [ $better, $good ], );
This class allows you to specify fallback lists for resources easily.
The resources will be delegated to appropriately.
The only difference is that sometimes resources that return false from
could_allocatewill still have
try_allocatingcalled on them, because the try list only requires that one of the sub resources return true from
It is trivial to subclass and override it such that
could_allocateonly returns true if all the sub resources do, thus resolving this issue. However, this seems to have a diminished practical value to me.
The array of resources to deleate to.
Module Install Instructions
To install POE::Component::ResourcePool, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install POE::Component::ResourcePool
For more information on module installation, please visit the detailed CPAN module installation guide.