NAME
Coro::PrioChannel - Priority message queues for Coro
VERSION
version 0.002
SYNOPSIS
use Coro::PrioChannel;
my $q = Coro::PrioChannel->new($maxsize);
$q->put("xxx"[, $prio]);
print $q->get;
DESCRIPTION
A Coro::PrioChannel is exactly like Coro::Channel, but with priorities. The priorities are the same as for Coro itself.
Unlike Coro::Channel, you do have to load this module directly.
- new
-
Create a new channel with the given maximum size. Giving a size of one defeats the purpose of a priority queue.
- put
-
Put the given scalar into the queue. Optionally provide a priority between Coro::PRIO_MIN and Coro::PRIO_MAX.
- get
-
Return the next element from the queue at the highest priority, waiting if necessary.
- shutdown
-
Same as Coro::Channel.
- size
-
Same as Coro::Channel.
AUTHOR
Darin McBride <dmcbride@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Darin McBride.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.