Acme-Urinal
view release on metacpan or search on metacpan
lib/Acme/Urinal.pm view on Meta::CPAN
=head2 pick_one
my $index = Acme::Urinal->pick_one;
my ($index, $resource, $comfort_level) = Acme::Urinal->pick_one;
This will choose an available resource from those available using the algorithm
described in the L</DESCRIPTION>. If no resource is available, the return will
be C<undef> or an empty list.
In scalar context, the index of the resource is returned. In list context, a
three-element list is returned where the first element is the index, the second
is the resource that was allocated, and the third is the comfort level with
which the resource was allocated. The higher the level, the better the
allocation was (the earlier the rule from the L</DESCRIPTION> that was used to
make the allocation). Currently, the comfort level will be between 1 and 5.
=cut
sub pick_one {
my ($self) = @_;
( run in 1.807 second using v1.01-cache-2.11-cpan-39bf76dae61 )