Skip to content

manuelm/minion-backend-storable

 
 

Repository files navigation

Minion::Backend::Storable Build Status

A file-based backend for Minion.

use Mojolicious::Lite;

plugin Minion => {Storable => '/some/path/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 $c = shift;
  $c->minion->enqueue(slow_log => [$c->param('msg') // 'no message']);
  $c->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

About

File-based backend for Minion job queues, using Storable

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Perl 100.0%