line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Proc::Launcher::Supervisor; |
2
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
133
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
58
|
|
|
3
|
|
|
|
|
169
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.0.37'; # VERSION |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
15
|
use Moo; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
18
|
|
8
|
3
|
|
|
3
|
|
887
|
use MooX::Types::MooseLike::Base qw(Bool Str Int InstanceOf HashRef); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
632
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'monitor_delay' => ( is => 'rw', |
11
|
|
|
|
|
|
|
isa => Int, |
12
|
|
|
|
|
|
|
default => 15, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'manager' => ( is => 'rw', |
16
|
|
|
|
|
|
|
isa => InstanceOf['Proc::Launcher::Manager'], |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub monitor { |
21
|
0
|
|
|
0
|
1
|
|
my ( $self ) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
sleep 5; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
while ( 1 ) { |
26
|
0
|
|
|
|
|
|
$self->manager->start(); |
27
|
0
|
|
|
|
|
|
sleep $self->monitor_delay; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |