File Coverage

blib/lib/Beam/Minion/Command/worker.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package Beam::Minion::Command::worker;
2             our $VERSION = '0.014';
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   59841 use strict;
  1         10  
  1         23  
40 1     1   3 use warnings;
  1         2  
  1         22  
41 1     1   348 use Beam::Minion::Util qw( build_mojo_app );
  1         3  
  1         62  
42 1     1   384 use Minion::Command::minion::worker;
  1         595  
  1         6  
43              
44             sub run {
45 2     2 0 191796 my ( $class, @args ) = @_;
46 2         18 my $app = build_mojo_app();
47 1         13 my $cmd = Minion::Command::minion::worker->new( app => $app );
48 1         12 $cmd->run( @args );
49             }
50              
51             1;
52              
53             __END__