line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Telnet::Gearman::Worker; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
20527
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
68
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
5
|
2
|
|
|
2
|
|
9
|
use base qw/Class::Accessor::Fast/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1766
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw/file_descriptor ip_address client_id functions/); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub parse_line { |
10
|
6
|
|
|
6
|
0
|
6935
|
my ( $package, $line ) = @_; |
11
|
|
|
|
|
|
|
|
12
|
6
|
|
|
|
|
39
|
my ( $fd, $ip, $cid, $col, @functions ) = split /\s+/, $line; |
13
|
|
|
|
|
|
|
|
14
|
6
|
|
|
|
|
49
|
return $package->new( |
15
|
|
|
|
|
|
|
{ |
16
|
|
|
|
|
|
|
file_descriptor => $fd, |
17
|
|
|
|
|
|
|
ip_address => $ip, |
18
|
|
|
|
|
|
|
client_id => $cid, |
19
|
|
|
|
|
|
|
functions => [@functions], |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Net::Telnet::Gearman::Worker |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use Net::Telnet::Gearman; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $session = Net::Telnet::Gearman->new( |
33
|
|
|
|
|
|
|
Host => '127.0.0.1', |
34
|
|
|
|
|
|
|
Port => 4730, |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my @workers = $session->workers(); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
print Dumper @workers |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# $VAR1 = bless( |
42
|
|
|
|
|
|
|
# { |
43
|
|
|
|
|
|
|
# 'client_id' => '-', |
44
|
|
|
|
|
|
|
# 'file_descriptor' => '1', |
45
|
|
|
|
|
|
|
# 'functions' => [ 'resize_image' ], |
46
|
|
|
|
|
|
|
# 'ip_address' => '127.0.0.1' |
47
|
|
|
|
|
|
|
# }, |
48
|
|
|
|
|
|
|
# 'Net::Telnet::Gearman::Worker' |
49
|
|
|
|
|
|
|
# ); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 METHODS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 file_descriptor |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Returns the file descriptor of this worker. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 ip_address |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Returns the ip address this worker is connected from. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 client_id |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns the client id of this worker. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 functions |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Returns an arrayref of functions the worker is registered for. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Johannes Plunien Eplu@cpan.orgE |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Copyright 2009 by Johannes Plunien |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
78
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 SEE ALSO |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=over 4 |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |