Spread::Queue::FIFO - basic FIFO queue


Spread-Queue documentation  | view source Contained in the Spread-Queue distribution.

Index


NAME

Top

Spread::Queue::FIFO - basic FIFO queue

SYNOPSIS

Top

  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

Top

Basic FIFO queue service. Not thread-safe.

Logging via Log::Channel.

METHODS

Top

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

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

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

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

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

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

  my $tasks = $q->pending;

Retrieve number of items in the queue.

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

Return the queue contents as a list, for inspection.

AUTHOR

Top

Jason W. May <jmay@pobox.com>

COPYRIGHT

Top

SEE ALSO

Top

  L<Spread::Queue>


Spread-Queue documentation  | view source Contained in the Spread-Queue distribution.