The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Spread::Queue - One-of-many queued messaging delivery, using Spread

SYNOPSIS

Queue manager

  $ sqm myqueue

Worker ("server") process

  use Spread::Queue::Worker;

  my $worker = new Spread::Queue::Worker("myqueue");
  $worker->callbacks(
                     myfunc => \&myfunc,
                    );
  $SIG{INT} = \&signal_handler;
  $worker->run;

  sub myfunc {
    my ($worker, $originator, $input) = @_;

    my $result = {
                  response => "I heard you!",
                 };
    $worker->respond($originator, $result);
  }

Requesting ("client") process

  use Spread::Queue::Sender;

  my $sender = new Spread::Queue::Sender("myqueue");

  $sender->submit("myfunc", { name => "value" });
  my $response = $sender->receive;

or

  my $response = $sender->rpc("myfunc", { name => "value" });

WARNING

THIS IS ALPHA SOFTWARE. There are no guarantees that the current interchange will remain, or that it will work in even remotely the same way.

DESCRIPTION

Message-queueing layer using Spread for message delivery.

Queues are managed by a dedicated manager process (sqm). This agent coordinates task assignments for some number of workers who accept messages delivered to a queue (a Spread public group).

Workers register their availability with the queue manager, and are assigned tasks when available. The worker knows the originator of each message, so responses (if needed) can be sent directly to the originator's private mailbox.

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>
  http://www.tibco.com/products/rv/index.html