NAME

Jonk::Job - Jonk job class.

SYNOPSIS

my $job = $jonk->lookup_job($job_id);
$job->arg;
$job->completed; # complete and delete job
$job->failed;    # failed and update job for retry
$job->aborted;   # failed and delete job

METHODS

$job->id

get job id.

$job->func

get job function name

$job->arg.

get job argument.

$job->enqueue_time

get job enqueued time.

$job->grabbed_until

get job grabbed until time.

$job->retry_cnt

get job retried count

$job->run_after

get job run after time

$job->priority

get job priority num

$job->completed

completed job.

and delete job data from database.

$job->failed([$options]);

failed job. set error message and delete job data from database.

  • $options->{retry_delay}

    job retry delay sec.

    Default 60 sec.

$job->aborted

aborted job. set error message and delete job data from database.

$job->is_failed

$job->is_aborted