NAME
Minion::Job - Minion job
SYNOPSIS
use Minion::Job;
my $job = Minion::Job->new(doc => $doc, worker => $worker);
DESCRIPTION
Minion::Job is a container for Minion jobs.
ATTRIBUTES
Minion::Job implements the following attributes.
doc
my $doc = $job->doc;
$job = $job->doc({});
BSON document for job.
worker
my $worker = $job->worker;
$job = $job->worker(Minion::Worker->new);
Minion::Worker object this job belongs to.
METHODS
Minion::Job inherits all methods from Mojo::Base and implements the following new ones.
app
my $app = $job->app;
Get application from "app" in Minion.
# Longer version
my $app = $job->worker->minion->app;
fail
$job = $job->fail;
$job = $job->fail('Something went wrong!');
Update job to failed
state.
finish
$job = $job->finish;
Update job to finished
state.
perform
$job->perform;
Perform job in new process and wait for it to finish.