line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gearman::Spawner; |
2
|
|
|
|
|
|
|
|
3
|
24
|
|
|
24
|
|
392262
|
use strict; |
|
24
|
|
|
|
|
65
|
|
|
24
|
|
|
|
|
759
|
|
4
|
24
|
|
|
24
|
|
131
|
use warnings; |
|
24
|
|
|
|
|
51
|
|
|
24
|
|
|
|
|
724
|
|
5
|
|
|
|
|
|
|
|
6
|
24
|
|
|
24
|
|
297
|
use 5.10.0; |
|
24
|
|
|
|
|
77
|
|
|
24
|
|
|
|
|
1626
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.11'; |
9
|
|
|
|
|
|
|
|
10
|
24
|
|
|
24
|
|
125
|
use Carp qw( croak ); |
|
24
|
|
|
|
|
72
|
|
|
24
|
|
|
|
|
1358
|
|
11
|
24
|
|
|
24
|
|
15159
|
use Gearman::Spawner::Supervisor; |
|
24
|
|
|
|
|
75
|
|
|
24
|
|
|
|
|
4566
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
22
|
|
|
22
|
1
|
5454
|
my $this = shift; |
15
|
22
|
|
33
|
|
|
549
|
my $class = ref $this || $this; |
16
|
|
|
|
|
|
|
|
17
|
22
|
|
|
|
|
561
|
my %params = @_; |
18
|
|
|
|
|
|
|
|
19
|
22
|
|
33
|
|
|
244
|
$params{servers} // croak "need servers"; |
20
|
22
|
|
33
|
|
|
168
|
$params{workers} // croak "need workers"; |
21
|
|
|
|
|
|
|
|
22
|
22
|
|
|
|
|
691
|
my $pid = Gearman::Spawner::Supervisor->start(%params); |
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
|
|
244
|
return bless { |
25
|
|
|
|
|
|
|
pid => $pid, |
26
|
|
|
|
|
|
|
}, $class; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub pid { |
30
|
2
|
|
|
2
|
0
|
1000262
|
my $self = shift; |
31
|
2
|
|
|
|
|
64
|
return $self->{pid}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub DESTROY { |
35
|
4
|
|
|
4
|
|
11540
|
my $self = shift; |
36
|
4
|
|
|
|
|
963802
|
kill 'INT', $self->{pid}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |