NAME
Minion::Worker - Minion worker
SYNOPSIS
use Minion::Worker;
my $worker = Minion::Worker->new(minion => $minion);
DESCRIPTION
Minion::Worker performs jobs for Minion.
ATTRIBUTES
Minion::Worker implements the following attributes.
id
my $oid = $worker->id;
$worker = $worker->id($oid);
Worker id.
minion
my $minion = $worker->minion;
$worker = $worker->minion(Minion->new);
Minion object this worker belongs to.
number
my $num = $worker->number;
$worker = $worker->number(5);
Number of this worker, unique per process.
METHODS
Minion::Worker inherits all methods from Mojo::Base and implements the following new ones.
dequeue
my $job = $worker->dequeue;
Dequeue Minion::Job object and transition from inactive
to active
state or return undef
if queue was empty.
register
$worker = $worker->register;
Register worker.
started
my $epoch = $worker->started;
Time this worker was started in floating seconds since the epoch.
unregister
$worker = $worker->unregister;
Unregister worker.