| 1 | package Sys::Bprsync::Job; | ||
| 2 | { | ||
| 3 | 1 | $Sys::Bprsync::Job::VERSION = '0.25'; | |
| 4 | } | ||
| 5 | 1 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | $Sys::Bprsync::Job::AUTHORITY = 'cpan:TEX'; | |
| 7 | } | ||
| 8 | # ABSTRACT: an bprsync job, spawns a worker | ||
| 9 | |||
| 10 | 1 | ▶ | use 5.010_000; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 1 | ▶ | use mro 'c3'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 1 | ▶ | use feature ':5.10'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | # use IO::Handle; | ||
| 18 | # use autodie; | ||
| 19 | # use MooseX::Params::Validate; | ||
| 20 | |||
| 21 | 1 | ▶ | use Sys::Bprsync::Worker; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 1 | extends 'Job::Manager::Job'; | |
| 24 | |||
| 25 | 1 | has 'parent' => ( | |
| 26 | 'is' => 'ro', | ||
| 27 | 'isa' => 'Sys::Bprsync', | ||
| 28 | 'required' => 1, | ||
| 29 | ); | ||
| 30 | |||
| 31 | 1 | has 'name' => ( | |
| 32 | 'is' => 'ro', | ||
| 33 | 'isa' => 'Str', | ||
| 34 | 'required' => 1, | ||
| 35 | ); | ||
| 36 | |||
| 37 | 1 | has 'verbose' => ( | |
| 38 | 'is' => 'rw', | ||
| 39 | 'isa' => 'Bool', | ||
| 40 | 'default' => 0, | ||
| 41 | ); | ||
| 42 | |||
| 43 | 1 | has 'dry' => ( | |
| 44 | 'is' => 'ro', | ||
| 45 | 'isa' => 'Bool', | ||
| 46 | 'default' => 0, | ||
| 47 | ); | ||
| 48 | |||
| 49 | 0 | ▶ | sub _init_worker { |
|
Subroutine
_init_worker: not called CC=1 SCAR=6.9
| |||
| 50 | 0 | my $self = shift; | |
| 51 | |||
| 52 | 0 | my $Worker = Sys::Bprsync::Worker::->new( | |
| 53 | { | ||
| 54 | 'config' => $self->config(), | ||
| 55 | 'logger' => $self->logger(), | ||
| 56 | 'parent' => $self->parent(), | ||
| 57 | 'name' => $self->name(), | ||
| 58 | 'verbose' => $self->verbose(), | ||
| 59 | 'dry' => $self->dry(), | ||
| 60 | } | ||
| 61 | ); | ||
| 62 | |||
| 63 | 0 | return $Worker; | |
| 64 | } | ||
| 65 | |||
| 66 | 1 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 67 | 1 | __PACKAGE__->meta->make_immutable; | |
| 68 | |||
| 69 | 1 | 1; | |
| 70 | |||
| 71 | __END__ | ||