<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
# Minion [![Build Status](https://travis-ci.org/kraih/minion.svg?branch=master)](https://travis-ci.org/kraih/minion)

  A [Mango](https://github.com/kraih/mango) job queue for the
  [Mojolicious](http://mojolicio.us) real-time web framework.

```perl
use Mojolicious::Lite;

my $uri = 'mongodb://&lt;user&gt;:&lt;pass&gt;@&lt;server&gt;/&lt;database&gt;';
plugin Minion =&gt; {uri =&gt; $uri};

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

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

app-&gt;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](http://perlbrew.pl) environment.
</pre></body></html>