line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Worker.pm 2234 2014-04-08 13:05:14Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::SinFP3::Worker; |
5
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
3
|
use base qw(Class::Gomor::Array); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
173
|
|
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
|
|
4
|
use constant NS_WORKER_FAIL => 0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3317
|
|
28
|
1
|
|
|
1
|
|
18
|
use constant NS_WORKER_SUCCESS => 1; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
427
|
|
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__ |