File Coverage

blib/lib/Proc/Launcher/Supervisor.pm
Criterion Covered Total %
statement 12 17 70.5
branch n/a
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 23 73.9


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__