Jason W. May

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>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 38:

'=item' outside of any '=over'

Around line 138:

You forgot a '=back' before '=head1'