File Coverage

blib/lib/Beam/Minion/Command/worker.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 16 17 94.1


line stmt bran cond sub pod time code
1             package Beam::Minion::Command::worker;
2             our $VERSION = '0.016';
3             # ABSTRACT: Command to run a Beam::Minion worker
4              
5             #pod =head1 SYNOPSIS
6             #pod
7             #pod beam minion worker
8             #pod
9             #pod =head1 DESCRIPTION
10             #pod
11             #pod This command takes all the L containers located on the
12             #pod C environment variable and starts a L worker
13             #pod that will run any services inside.
14             #pod
15             #pod Service jobs are added to the queue using the L
16             #pod command|Beam::Minion::Command::run>.
17             #pod
18             #pod =head1 ENVIRONMENT
19             #pod
20             #pod =head2 BEAM_MINION
21             #pod
22             #pod This variable defines the shared database to coordinate the Minion workers. This
23             #pod database is used to queue the job. This must be the same for all workers
24             #pod and every job running.
25             #pod
26             #pod See L for how to set this variable.
27             #pod
28             #pod =head2 BEAM_PATH
29             #pod
30             #pod This variable is a colon-separated list of directories to search for
31             #pod containers.
32             #pod
33             #pod =head1 SEE ALSO
34             #pod
35             #pod L, L
36             #pod
37             #pod =cut
38              
39 1     1   71723 use Mojo::Base -base;
  1         186359  
  1         8  
40 1     1   745 use Beam::Minion::Util qw( build_mojo_app );
  1         4  
  1         73  
41 1     1   473 use Minion::Command::minion::worker;
  1         808  
  1         9  
42              
43             has app => sub { build_mojo_app() };
44             sub run {
45 2     2 0 222373 my ( $self, @args ) = @_;
46 2         22 my $cmd = Minion::Command::minion::worker->new( app => $self->app );
47 1         65 $cmd->run( @args );
48             }
49              
50             1;
51              
52             __END__