13 Feb 2018 13:37:13 UTC
- Distribution: Piper
- Module version: 0.05
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (619 / 0 / 0)
- KwaliteeBus factor: 0
- 97.29% Coverage
- License: apache_2_0
- Perl: v5.10.0
- Activity24 month
- Download (53.74KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- 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
$numitems from the queue.
$numshould 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).
@itemsto the queue. It should not matter what the
@itemscontain, within reason.
Returns the number of items that are ready to be dequeued.
@itemsto the top of the queue in an order such that
dequeue(1)would subsequently return
$itemsand 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 <firstname.lastname@example.org>
This software is Copyright (c) 2017 by Mary Ehlers.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004