NAME

Jonk::Worker - get a job data class.

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

Creates a new Jonk object, and returns the object.

  • $dbh

    $dbh is database handle.

  • $options->{functions}

    Key word of job which this Jonk instance looks for.

  • $options->{table_name}

    specific job table name.

    Default job table name is `job`.

  • $options->{job_find_size}

    specific lookup job record size.

    Default 50.

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.

  • $job_id (optional)

    lookup specific $job_id's job.

$jonk->errstr;

get most recent error infomation.

ERROR HANDLING

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