Atsushi Kobayashi > Jonk > Jonk::Worker

Download:
Jonk-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

Jonk::Worker - get a job data class.

SYNOPSIS ^

    use DBI; 
    use Jonk::Worker;
    
    my $dbh = DBI->connect(...);
    my $jonk = Jonk::Worker->new($dbh, {functions => ['MyWorker']});
    my $job = $jonk->dequeue;
    print $job->{func}; # MyWorker
    print $job->{arg};  # arg

METHODS ^

my $jonk = Jonk::Worker->new($dbh, $options);

Creates a new Jonk object, and returns the object.

$options is an optional settings.

my $job_hash_ref = $jonk->dequeue($job_id);

dequeue a job from a database.

returns job hashref data.

Please do deserialize if it is necessary.

$jonk->errstr;

get most recent error infomation.

ERROR HANDLING ^

  my $job = $jonk->dequeue;
  if ($jonk->errstr) {
      die $jonk->errstr;
  }
syntax highlighting: