Subject: | Consider Future::Queue |
Some sort of push/pull queue based on Futures.
Basic API would look something like:
my $queue = Future::Queue->new;
$queue->push( $thing );
# Does this return a Future?
$queue->shift->then( ... );
# ->shift's future waits until an item is available and yields it
Options to consider:
* Bounded maximum number of outstanding items; maybe have ->push return a Future
that only completes once it's pushed
* Immediate "do or undef" methods; ->shift_or_undef to yield an item immediately
or else undef if nothing ready
--
Paul Evans