Minion Build Status

A job queue for the Mojolicious real-time web framework with support for multiple backends.

use Mojolicious::Lite;

plugin Minion => {File => '/Users/sri/minion.data'};

# Slow task
app->minion->add_task(slow_log => sub {
  my ($job, $msg) = @_;
  sleep 5;
  $job->app->log->debug(qq{Received message "$msg".});
});

# Perform job in a background worker process
get '/log' => sub {
  my $self = shift;
  $self->minion->enqueue(slow_log => [$self->param('msg') // 'no message']);
  $self->render(text => 'Your message will be logged soon.');
};

app->start;

Just start one or more background worker processes in addition to your web server.

$ ./myapp.pl minion worker

Installation

All you need is a oneliner, it takes less than a minute.

$ curl -L cpanmin.us | perl - -n Minion

We recommend the use of a Perlbrew environment.