line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gearman::Driver::Worker::Base; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1899
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Gearman::Driver::Worker::Base - Base class for workers without method attributes |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
If you don't like method attributes you can use this base class |
12
|
|
|
|
|
|
|
instead of L<Gearman::Driver::Worker> and use |
13
|
|
|
|
|
|
|
L<Gearman::Driver/add_job>. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has 'server' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
isa => 'Str', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub prefix { |
23
|
|
|
|
|
|
|
return ref(shift) . '::'; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub begin { } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub end { } |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub on_exception { } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub process_name { |
33
|
|
|
|
|
|
|
return 0; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub override_attributes { |
37
|
|
|
|
|
|
|
return {}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub default_attributes { |
41
|
|
|
|
|
|
|
return {}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub decode { |
45
|
|
|
|
|
|
|
my ( $self, $result ) = @_; |
46
|
|
|
|
|
|
|
return $result; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub encode { |
50
|
|
|
|
|
|
|
my ( $self, $result ) = @_; |
51
|
|
|
|
|
|
|
return $result; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
no Moose; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AUTHOR |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
See L<Gearman::Driver>. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
See L<Gearman::Driver>. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SEE ALSO |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=over 4 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item * L<Gearman::Driver> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Adaptor> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Console> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Console::Basic> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Console::Client> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Job> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Job::Method> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Loader> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Observer> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Worker> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * L<Gearman::Driver::Worker::AttributeParser> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=back |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |