[Spread-users] Spread::Queue - Perl message queues using Spread

Jason W. May jmay at pobox.com
Wed Feb 13 21:30:47 EST 2002

I've just released an alpha version of Spread::Queue on CPAN.  This
builds on top of the Spread::Session module I posted earlier.

Questions and comments appreciated.



Queue manager  

  $ sqm myqueue

Worker ("server") process  

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

  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;
  my $response = $sender->rpc("myfunc", { name => "value" });

More information about the Spread-users mailing list