NAME
Spread::Queue::Manager - coordinate one-of-many message delivery
SYNOPSIS
The provided 'sqm' executable does this:
use Spread::Queue::Manager;
my $queue_name = shift @ARGV || die "usage: sqm queue-name";
my $session = new Spread::Queue::Manager($queue_name);
$session->run;
DESCRIPTION
The queue manager is responsible for assigning incoming messages (see Spread::Queue::Sender) to registered workers (see Spread::Queue::Worker).
When a message comes in, it is assigned to the first available worker, otherwise it is put into a FIFO queue.
When a worker reports availability, it is sent the first pending message, otherwise it is put into a FIFO queue.
When a message is sent to a worker, the worker should immediately acknowledge receipt. If the worker does not acknowledge, the message will (eventually) be assigned to another worker.
If a queue manager is already running (detected via Spread group membership messages), the new sqm should terminate.
METHODS
- new
-
my $session = new Spread::Queue::Manager($queue_name);
Initialize Spread messaging environment, and prepare to act as the queue manager. If queue_name is omitted, environment variable SPREAD_QUEUE will be checked.
- new
-
$session->run;
Run loop for the queue manager. Does not return unless interrupted.
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.
The license for the Spread software can be found at http://www.spread.org/license
SEE ALSO
L<Spread::Session>
L<Spread::Queue::FIFO>
L<Spread::Queue::Sender>
L<Spread::Queue::Worker>
L<Spread::Queue::ManagedWorker>
L<Data::Serializer>
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 63:
'=item' outside of any '=over'
- Around line 393:
You forgot a '=back' before '=head1'