line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Worker.pm,v 451c3602d7b2 2015/11/25 06:13:53 gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::SinFP3::Worker; |
5
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
48
|
|
6
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
8
|
use base qw(Class::Gomor::Array); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
264
|
|
9
|
|
|
|
|
|
|
our @AS = qw( |
10
|
|
|
|
|
|
|
global |
11
|
|
|
|
|
|
|
callback |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
17
|
|
|
|
|
|
|
consts => [qw( |
18
|
|
|
|
|
|
|
NS_WORKER_SUCCESS |
19
|
|
|
|
|
|
|
NS_WORKER_FAIL |
20
|
|
|
|
|
|
|
)], |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our @EXPORT_OK = ( |
24
|
|
|
|
|
|
|
@{$EXPORT_TAGS{consts}}, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
1
|
|
10
|
use constant NS_WORKER_FAIL => 0; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
114
|
|
28
|
1
|
|
|
1
|
|
10
|
use constant NS_WORKER_SUCCESS => 1; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
455
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
31
|
0
|
|
|
0
|
1
|
|
my $self = shift->SUPER::new( |
32
|
|
|
|
|
|
|
@_, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
if (!defined($self->global)) { |
36
|
0
|
|
|
|
|
|
die("[-] ".__PACKAGE__.": You must provide a global attribute\n"); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $log = $self->global->log; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my ($model) = caller(); |
42
|
0
|
|
|
|
|
|
$log->verbose("Will use [$model] as worker model"); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub init { |
48
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
49
|
0
|
|
|
|
|
|
my %h = @_; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$self->callback($h{callback}); |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return $self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub run { |
57
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
return $self; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub post { |
62
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
63
|
0
|
|
|
|
|
|
return $self; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub clean { |
67
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
68
|
0
|
|
|
|
|
|
return $self; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |