line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Protocol::Redis::XS; |
2
|
2
|
|
|
2
|
|
98844
|
use strict; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
60
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
55
|
|
4
|
2
|
|
|
2
|
|
945
|
use parent "Protocol::Redis"; |
|
2
|
|
|
|
|
660
|
|
|
2
|
|
|
|
|
12
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
3942
|
use XS::Object::Magic; |
|
2
|
|
|
|
|
1263
|
|
|
2
|
|
|
|
|
95
|
|
7
|
2
|
|
|
2
|
|
15
|
use XSLoader; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
380
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
XSLoader::load "Protocol::Redis::XS", $VERSION; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
2
|
|
|
2
|
1
|
3401
|
my($class, %args) = @_; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
9
|
my $on_message = delete $args{on_message}; |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
|
|
15
|
my $self = bless \%args, $class; |
19
|
2
|
50
|
|
|
|
5
|
return unless $self->api == 1; |
20
|
2
|
50
|
|
|
|
7
|
$self->on_message($on_message) if defined $on_message; |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
88
|
$self->_create; |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
9
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# See Protocol::Redis for description of the API versioning |
28
|
|
|
|
|
|
|
sub api { |
29
|
3
|
|
|
3
|
1
|
1036
|
my($self) = @_; |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
20
|
$self->{api}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub on_message { |
35
|
5
|
|
|
5
|
1
|
1229
|
my($self, $cb) = @_; |
36
|
5
|
|
|
|
|
18
|
$self->{_on_message_cb} = $cb; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |