Jason W. May > Spread-Queue > Spread::Queue::FIFO

Download:
Spread-Queue-0.4.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.3   Source  

NAME ^

Spread::Queue::FIFO - basic FIFO queue

SYNOPSIS ^

  use Spread::Queue::FIFO;

  my $q = new Spread::Queue::FIFO ("to-do list");
  enqueue $q, "eat breakfast", "go to work";
  my $task = dequeue $q;

DESCRIPTION ^

Basic FIFO queue service. Not thread-safe.

Logging via Log::Channel.

METHODS ^

new
  my $q = new Spread::Queue::FIFO ("to-do list");

Creates a named FIFO queue. Name will be included in each log message.

enqueue
  enqueue $q, "eat breakfast", "go to work";

Append one or more items to the end of a queue.

dequeue
  my $node = dequeue $q;
  my ($queue_pending_time, $task) = @$node;

Remove the first item from the front of the queue and return it.

pending
  my $tasks = $q->pending;

Retrieve number of items in the queue.

pending
 foreach my $item ($q->all) { ... }

Return the queue contents as a list, for inspection.

AUTHOR ^

Jason W. May <jmay@pobox.com>

COPYRIGHT ^

Copyright (C) 2002 Jason W. May. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

  L<Spread::Queue>
syntax highlighting: