NAME

Beam::Minion::Util - Utility functions for Beam::Minion

VERSION

version 0.016

SYNOPSIS

    use Beam::Minion::Util qw( minion );

    my $minion = minion();
    my %attrs = minion_attrs();

DESCRIPTION

This module contains helper routines for Beam::Minion.

SUBROUTINES

minion_init_args

    my %args = minion_init_args();

Get the arguments needed to initialize a new Minion instance by parsing the BEAM_MINION environment variable.

This environment variable can take a few forms:

<url>

A simple backend URL like postgres://postgres@/test, sqlite:/tmp/minion.db, mongodb://127.0.0.1:27017, or mysql://user@127.0.0.1/minion. The following backends are supported: Minion::Backend::SQLite, Minion::Backend::Pg, Minion::Backend::MongoDB, Minion::Backend::mysql.

<backend>+<url>

A backend name and arguments, separated by +, like Storable+/tmp/minion.db. Any backend may be used this way.

If your backend requires more arguments, you can separate them with +:

    # Configure the MySQL backend with a DBI DSN
    BEAM_MINION=mysql+dsn+dbi:mysql:minion

minion

    my $minion = minion();

Get a Minion instance as configured by the BEAM_MINION environment variable (parsed by "minion_init_args").

build_mojo_app

Build the Mojolicious app that contains the Minion plugin (Mojolicious::Plugin::Minion) and tasks. This can then be given to one of the Minion::Command classes to execute commands.

SEE ALSO

Beam::Minion

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.