- SEE ALSO
- COPYRIGHT AND LICENSE
Piper::Role::Queue - Basic queue role used by the Piper system
This role requires the following object methods.
Removes and returns
$num items from the queue.
$num should be 1. If wantarray, should return an array of items from the queue. Otherwise, should return the last of the dequeued items (allows singleton dequeues, behaving similar to splice):
Ex: my @results = $queue->dequeue($num); my $single = $queue->dequeue;
If requesting more items than are left in the queue, should only return the items left in the queue (and should not return
undefs as placeholders).
@items to the queue. It should not matter what the
@items contain, within reason.
Returns the number of items that are ready to be dequeued.
@items to the top of the queue in an order such that
dequeue(1) would subsequently return
$items and so forth.
Verify the functionality of a new queue class by downloading the Piper tests and running the following:
PIPER_QUEUE_CLASS=<New queue class> prove t/01_Queue.t
Mary Ehlers <email@example.com>
This software is Copyright (c) 2017 by Mary Ehlers.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004