Skip to content

Commit

Permalink
more precise event descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 26, 2015
1 parent 1d0d98a commit 3f10630
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
8 changes: 7 additions & 1 deletion lib/Minion.pm
Expand Up @@ -167,7 +167,7 @@ following new ones.
...
});
Emitted when a new worker is created.
Emitted in the worker process after it has been created.
$minion->on(worker => sub {
my ($minion, $worker) = @_;
Expand Down Expand Up @@ -254,6 +254,12 @@ Job priority, defaults to C<0>.
Get L<Minion::Job> object without making any changes to the actual job or
return C<undef> if job does not exist.
# Check job state
my $state = $minion->job($id)->info->{state};
# Get job result
my $result = $minion->job($id)->info->{result};
=head2 new
my $minion = Minion->new(File => '/Users/sri/minion.db');
Expand Down
15 changes: 12 additions & 3 deletions lib/Minion/Job.pm
Expand Up @@ -81,7 +81,8 @@ following new ones.
...
});
Emitted after this job transitioned to the C<failed> state.
Emitted in the worker process managing this job or the process performing it,
after it has transitioned to the C<failed> state.
$job->on(failed => sub {
my ($job, $err) = @_;
Expand All @@ -95,7 +96,8 @@ Emitted after this job transitioned to the C<failed> state.
...
});
Emitted after this job transitioned to the C<finished> state.
Emitted in the worker process managing this job or the process performing it,
after it has transitioned to the C<finished> state.
$job->on(finished => sub {
my ($job, $result) = @_;
Expand All @@ -110,7 +112,8 @@ Emitted after this job transitioned to the C<finished> state.
...
});
Emitted after a process has been spawned to process this job.
Emitted in the worker process managing this job, after a new process has been
spawned for processing.
$job->on(spawn => sub {
my ($job, $pid) = @_;
Expand Down Expand Up @@ -186,6 +189,12 @@ Transition from C<active> to C<finished> state.
Get job information.
# Check job state
my $state = $job->info->{state};
# Get job result
my $result = $job->info->{result};
=head2 perform
$job->perform;
Expand Down
2 changes: 1 addition & 1 deletion lib/Minion/Worker.pm
Expand Up @@ -61,7 +61,7 @@ the following new ones.
...
});
Emitted when a job has been dequeued.
Emitted in the worker process when a job has been dequeued.
$worker->on(dequeue => sub {
my ($worker, $job) = @_;
Expand Down

0 comments on commit 3f10630

Please sign in to comment.