hine::DB::VERSION = '0.18';
}
use strict;
use warnings;
use Carp qw/croak confess/;
use DBI;
use JSON;
use constant QUEUE_PREFIX => 'jm:';
use constant RESPONSE_PREFIX => 'jmr:';
sub new {
my (
$args{schema} ||= 'jobmachine';
return bless \%args, $class;
}
sub json {
my ($self) = @_;
return $self->{json} ||= JSON->new->allow_nonref;
}
sub listen {
my ($self, %args) = @_;
my $queue
;
my $class = $self->fetch_class($queue);
$self->{current_table} = 'task';
my $frozen = $self->json->encode($data);
my $sql = qq{
INSERT INTO
"$self->{schema}".$self->{current_table}
(clas