Kaare Rasmussen > Job-Machine > Job::Machine::DB

Download:
Job-Machine-0.19.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.19   Source  

NAME ^

Job::Machine::DB

VERSION ^

version 0.19

NAME ^

Job::Machine::DB - Database class for Job::Machine

METHODS ^

new

  my $client = Job::Machine::DB->new(
          dbh   => $dbh,
          queue => 'queue.subqueue',

  );

  my $client = Job::Machine::Base->new(
          dsn   => @dsn,
  );

set_listen

 $self->listen( queue => 'queue_name' );
 $self->listen( queue => \@queues, reply => 1  );

Sets up the listener. Quit listening to the named queues. If 'reply' is passed, we unlisten to the related reply queue instead of the task queue.

Return undef immediately if no queue is provided.

unlisten

 $self->unlisten( queue => 'queue_name' );
 $self->unlisten( queue => \@queues, reply => 1  );

Quit listening to the named queues. If 'reply' is passed, we unlisten to the related reply queue instead of the task queue.

Return undef immediately if no queue is provided.

notify

 $self->notify( queue => 'queue_name' );
 $self->notify( queue => 'queue_name', reply => 1, payload => $data  );

Sends an asynchronous notification to the named queue, with an optional payload. If 'reply' is true, then the queue names are taken to be reply.

Return undef immediately if no queue name is provided.

get_notification

 my $notifies = $self->get_notification();

Retrievies the pending notifications. The return value is an arrayref where each row looks like this:

 my ($name, $pid, $payload) = @$notify;

AUTHOR ^

Kaare Rasmussen <kaare@cpan.org>.

COPYRIGHT ^

Copyright (C) 2009,2014, Kaare Rasmussen

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.

AUTHOR ^

Kaare Rasmussen <kaare at cpan dot net>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2014 by Kaare Rasmussen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: