Job::Machine::DB
version 0.21
Job::Machine::DB - Database class for Job::Machine
my $client = Job::Machine::DB->new( dbh => $dbh, queue => 'queue.subqueue', ); my $client = Job::Machine::Base->new( dsn => @dsn, );
$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.
$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.
$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.
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;
Kaare Rasmussen <kaare@cpan.org>.
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.
Kaare Rasmussen <kaare at cpan dot net>
This software is copyright (c) 2015 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.
To install Job::Machine::DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Job::Machine::DB
CPAN shell
perl -MCPAN -e shell install Job::Machine::DB
For more information on module installation, please visit the detailed CPAN module installation guide.