line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ZMQ; |
2
|
4
|
|
|
4
|
|
75246
|
use strict; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
666
|
|
3
|
|
|
|
|
|
|
our $VERSION = '1.06'; |
4
|
|
|
|
|
|
|
our $BACKEND; |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
4
|
|
33
|
4
|
|
71
|
$BACKEND ||= $ENV{PERL_ZMQ_BACKEND}; |
7
|
4
|
50
|
|
|
|
16
|
if ( $BACKEND ) { |
8
|
0
|
|
|
|
|
0
|
eval "require $BACKEND"; |
9
|
0
|
0
|
|
|
|
0
|
if ($@) { |
10
|
0
|
|
|
|
|
0
|
die $@; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
} else { |
13
|
4
|
|
|
|
|
13
|
foreach my $lib ( qw(ZMQ::LibZMQ2 ZMQ::LibZMQ3) ) { |
14
|
8
|
|
|
|
|
458
|
eval "require $lib"; |
15
|
8
|
50
|
|
|
|
54
|
if ($@) { |
16
|
8
|
|
|
|
|
21
|
next; |
17
|
|
|
|
|
|
|
} |
18
|
0
|
|
|
|
|
0
|
$BACKEND = $lib; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
4
|
50
|
|
|
|
22
|
if (! $BACKEND) { |
23
|
4
|
|
|
|
|
2885
|
die "Could not find a suitable backend for ZMQ"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use ZMQ::Context; |
28
|
|
|
|
|
|
|
use ZMQ::Socket; |
29
|
|
|
|
|
|
|
use ZMQ::Message; |
30
|
|
|
|
|
|
|
use ZMQ::Poller; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub call { |
33
|
|
|
|
|
|
|
my $funcname = shift; |
34
|
|
|
|
|
|
|
my $func = "${BACKEND}::$funcname"; |
35
|
|
|
|
|
|
|
no strict 'refs'; |
36
|
|
|
|
|
|
|
goto &{$func}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |