line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2014 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Net::Gearman::Client; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
95918
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
100
|
|
9
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
101
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
9
|
use base qw( Net::Gearman Protocol::Gearman::Client ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
792
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
C - concrete Gearman client over an IP socket |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use Net::Gearman::Client; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $client = Net::Gearman::Client->new( |
24
|
|
|
|
|
|
|
PeerAddr => $SERVER, |
25
|
|
|
|
|
|
|
) or die "Cannot connect - $@\n"; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $total = $client->submit_job( |
28
|
|
|
|
|
|
|
func => "sum", |
29
|
|
|
|
|
|
|
arg => "10,20,30", |
30
|
|
|
|
|
|
|
)->get; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
say $total; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
This module combines the abstract L with |
37
|
|
|
|
|
|
|
L to provide a simple synchronous concrete client |
38
|
|
|
|
|
|
|
implementation. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 AUTHOR |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Paul Evans |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
0x55AA; |