« Conveyor/YAML/Marshall/Payload/InstructionContainer.pm
↑ Summary
Conveyor/Exception/Container.pm »
| 1 | 1 | ▶ | use 5.008; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package Data::Conveyor::App::Exported::Launcher; | ||||||||||||||||||||||||||||
| 6 | 1 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | $Data::Conveyor::App::Exported::Launcher::VERSION = '1.103130'; | |||||||||||||||||||||||||||
| 8 | } | ||||||||||||||||||||||||||||
| 9 | # ABSTRACT: Stage-based conveyor-belt-like ticket handling system | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Getopt::Long; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use IO::Handle; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use FindBin '$Bin'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use Exporter qw(import); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 1 | our @EXPORT = qw(start); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub start { | ||||||||||||||||||||||||||
|
Subroutine
start: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||
| 18 | 0 | STDOUT->autoflush; | |||||||||||||||||||||||||||
| 19 | 0 | STDERR->autoflush; | |||||||||||||||||||||||||||
| 20 | 0 | my %opt; | |||||||||||||||||||||||||||
| 21 | 0 | GetOptions( | |||||||||||||||||||||||||||
| 22 | \%opt, qw/ | ||||||||||||||||||||||||||||
| 23 | lockpath=s | ||||||||||||||||||||||||||||
| 24 | parallel=s | ||||||||||||||||||||||||||||
| 25 | / | ||||||||||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | usage() unless defined $opt{parallel} && $opt{lockpath}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $opt{"parallel"} and $opt{"lockpath"}
MC/DC0%0/2
defined $opt{"parallel"} and $opt{"lockpath"}
defined $opt{"parallel"}
$opt{"lockpath"}
Truth table0%0/3
A and B
A= defined $opt{"parallel"}B= $opt{"lockpath"}
| |||||||||||||||||||||||||||||
| 28 | 0 | for (qw/PROJROOT CF_CONF PERL5OPT/) { | |||||||||||||||||||||||||||
| 29 | 0 | ▶ | die "$_ not set" unless $ENV{$_}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | 0 | my @executable = ("$Bin/reg_dispatch.pl", "--lockpath=$opt{lockpath}"); | |||||||||||||||||||||||||||
| 32 | 0 | require Data::Conveyor::Lock::Dispatcher; | |||||||||||||||||||||||||||
| 33 | my $lockclass = Data::Conveyor::Lock::Dispatcher->new( | ||||||||||||||||||||||||||||
| 34 | lockpath => $opt{lockpath}, | ||||||||||||||||||||||||||||
| 35 | numlocks => $opt{parallel} | ||||||||||||||||||||||||||||
| 36 | 0 | ); | |||||||||||||||||||||||||||
| 37 | 0 | $lockclass->administrate_locks; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | # we lose the lock here, of course. in the worst case | ||||||||||||||||||||||||||||
| 40 | # though, we just bloat and finally end up without the lock. | ||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if ($lockclass->get_lock) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 0 | ▶ | exec $^X, @executable or die "exec @executable failed."; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | ▶ | sub usage () { | ||||||||||||||||||||||||||
|
Subroutine
usage: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 47 | 0 | (my $exe = $0) =~ s|.*/||; | |||||||||||||||||||||||||||
| 48 | 0 | printf STDERR <<'__EOF', $exe; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | Usage: | ||||||||||||||||||||||||||||
| 51 | %s --lockpath=<directory> --parallel=<n> | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | __EOF | ||||||||||||||||||||||||||||
| 54 | 0 | exit; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | 1 | 1; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | __END__ | ||||||||||||||||||||||||||||