|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
  
 
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package Redis::Fast;  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 BEGIN {  | 
| 
4
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
2735752
 | 
     use XSLoader;  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
431
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1707
 | 
    | 
| 
5
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
166
 | 
     our $VERSION = '0.35';  | 
| 
6
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
27067
 | 
     XSLoader::load __PACKAGE__, $VERSION;  | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
9
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
275
 | 
 use warnings;  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
167
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1063
 | 
    | 
| 
10
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
189
 | 
 use strict;  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
80
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1159
 | 
    | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
12
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
225
 | 
 use Carp qw/confess/;  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
92
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1849
 | 
    | 
| 
13
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
21715
 | 
 use Encode;  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
389800
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2573
 | 
    | 
| 
14
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
3693
 | 
 use Try::Tiny;  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14581
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1823
 | 
    | 
| 
15
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
236
 | 
 use Scalar::Util qw(weaken);  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
77
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1720
 | 
    | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
17
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
15289
 | 
 use Redis::Fast::Sentinel;  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
114
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
71797
 | 
    | 
| 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # small utilities for handling host and port  | 
| 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _join_host_port {  | 
| 
22
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
     my ($host, $port) = @_;  | 
| 
23
 | 
  
0
  
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     return "[$host]:$port" if $host =~ /:/ || $host =~ /%/;  | 
| 
24
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return "$host:$port";  | 
| 
25
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
26
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _split_host_port {  | 
| 
27
 | 
4
 | 
 
 | 
 
 | 
  
4
  
 | 
 
 | 
19
 | 
     my $hostport = shift;  | 
| 
28
 | 
4
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
47
 | 
     if ($hostport =~ /\A\[([^\]]+)\]:([0-9]+)\z/) {  | 
| 
29
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         return $1, $2;  | 
| 
30
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
31
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
24
 | 
     return split /:/, $hostport;  | 
| 
32
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
33
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
34
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _new_on_connect_cb {  | 
| 
35
 | 
70
 | 
 
 | 
 
 | 
  
70
  
 | 
 
 | 
466
 | 
     my ($self, $on_conn, $password, $name) = @_;  | 
| 
36
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
454
 | 
     weaken $self;  | 
| 
37
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $handler = sub {  | 
| 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         # If we are in PubSub mode we shouldn't perform any command besides  | 
| 
39
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         # (p)(un)subscribe  | 
| 
40
 | 
68
 | 
  
 50
  
 | 
 
 | 
  
68
  
 | 
 
 | 
383
 | 
         if (! $self->is_subscriber) {  | 
| 
41
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             defined $name  | 
| 
42
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 and try {  | 
| 
43
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     my $n = $name;  | 
| 
44
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     $n = $n->($self) if ref($n) eq 'CODE';  | 
| 
45
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     $self->client_setname($n) if defined $n;  | 
| 
46
 | 
68
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
216
 | 
                 };  | 
| 
47
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
296
 | 
             my $data = $self->__get_data;  | 
| 
48
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             defined $data->{current_database}  | 
| 
49
 | 
68
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
713
 | 
                 and $self->select($data->{current_database});  | 
| 
50
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
51
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
52
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
280
 | 
         my $subscribers = $self->__get_data->{subscribers};  | 
| 
53
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
422
 | 
         $self->__get_data->{subscribers} = {};  | 
| 
54
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
740
 | 
         $self->__get_data->{cbs} = undef;  | 
| 
55
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
183
 | 
         foreach my $topic (CORE::keys(%{$subscribers})) {  | 
| 
 
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
278
 | 
    | 
| 
56
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             if ($topic =~ /(p?message):(.*)$/ ) {  | 
| 
57
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 my ($key, $channel) = ($1, $2);  | 
| 
58
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 my $subs = $subscribers->{$topic};  | 
| 
59
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 if ($key eq 'message') {  | 
| 
60
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     $self->__subscription_cmd('',  0, subscribe => $channel, $_) for @$subs;  | 
| 
61
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 } else {  | 
| 
62
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     $self->__subscription_cmd('p',  0, psubscribe => $channel, $_) for @$subs;  | 
| 
63
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 }  | 
| 
64
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             }  | 
| 
65
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
66
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
67
 | 
68
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
469
 | 
         defined $on_conn  | 
| 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             and $on_conn->($self);  | 
| 
69
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2440
 | 
     };  | 
| 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
71
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return sub {  | 
| 
72
 | 
68
 | 
 
 | 
 
 | 
  
68
  
 | 
 
 | 
1215
 | 
         my $reconnect_stash = $self->__get_reconnect;  | 
| 
73
 | 
68
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
321
 | 
         if(defined $password) {  | 
| 
74
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             my $err;  | 
| 
75
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             $self->__set_reconnect(0);  | 
| 
76
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             try {  | 
| 
77
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 $self->auth($password);  | 
| 
78
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             } catch {  | 
| 
79
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 $err = $_;  | 
| 
80
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             };  | 
| 
81
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             if(defined $err) {  | 
| 
82
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 if($err =~ /ERR invalid password|WRONGPASS invalid username-password pair/) {  | 
| 
83
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                     # password setting is incorrect, no need to reconnect  | 
| 
84
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     die("Redis server refused password");  | 
| 
85
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 } else {  | 
| 
86
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                     # it might be network error  | 
| 
87
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                     # invoke reconnect  | 
| 
88
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     $self->__set_reconnect($reconnect_stash);  | 
| 
89
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     return ;  | 
| 
90
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 }  | 
| 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             }  | 
| 
92
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
93
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
94
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         try {  | 
| 
95
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             # disable reconnection while executing on_connect handler  | 
| 
96
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
15458
 | 
             $self->__set_reconnect(0);  | 
| 
97
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
254
 | 
             $handler->();  | 
| 
98
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         } catch {  | 
| 
99
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             $self->quit();  | 
| 
100
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         } finally {  | 
| 
101
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2433
 | 
             $self->__set_reconnect($reconnect_stash);  | 
| 
102
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3661
 | 
         };  | 
| 
103
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2711
 | 
     };  | 
| 
104
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
105
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
106
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _new_reconnect_on_error_cb {  | 
| 
107
 | 
70
 | 
 
 | 
 
 | 
  
70
  
 | 
 
 | 
410
 | 
     my ($self, $reconnect_on_error) = @_;  | 
| 
108
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
400
 | 
     weaken $self;  | 
| 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
110
 | 
70
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
315
 | 
     if ($reconnect_on_error) {  | 
| 
111
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         return sub {  | 
| 
112
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             # The unit should be second and the type should be double.  | 
| 
113
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             # -1 is a special value, it means that we do not reconnect.  | 
| 
114
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
             my $next_reconnect_interval = $reconnect_on_error->(@_);  | 
| 
115
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             if ($next_reconnect_interval < -1) {  | 
| 
116
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 warn "reconnect_on_error must not return a number less than -1";  | 
| 
117
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
118
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 # Reset a next_reconnect_interval and do not reconnect.  | 
| 
119
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 $next_reconnect_interval = -1;  | 
| 
120
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             }  | 
| 
121
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
122
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             # Wait until next_reconnect_interval seconds elapse.  | 
| 
123
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             $self->__set_next_reconnect_on_error_at($next_reconnect_interval);  | 
| 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
125
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             my $need_reconnect = 0;  | 
| 
126
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             if (-1 < $next_reconnect_interval) {  | 
| 
127
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 $need_reconnect = 1;  | 
| 
128
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             }  | 
| 
129
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             return $need_reconnect;  | 
| 
130
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         };  | 
| 
131
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     } else {  | 
| 
132
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
672
 | 
         return;  | 
| 
133
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
134
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
135
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
136
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub new {  | 
| 
137
 | 
70
 | 
 
 | 
 
 | 
  
70
  
 | 
  
0
  
 | 
482843
 | 
   my $class = shift;  | 
| 
138
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1395
 | 
   my %args  = @_;  | 
| 
139
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
7673
 | 
   my $self  = $class->_new;  | 
| 
140
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
141
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ## Deal with REDIS_SERVER ENV  | 
| 
142
 | 
70
 | 
  
  0
  
 | 
  
 33
  
 | 
 
 | 
 
 | 
706
 | 
   if ($ENV{REDIS_SERVER} && !$args{sock} && !$args{server}) {  | 
| 
 
 | 
 
 | 
 
 | 
  
 33
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
143
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ($ENV{REDIS_SERVER} =~ m!^/!) {  | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
144
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $args{sock} = $ENV{REDIS_SERVER};  | 
| 
145
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
146
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     elsif ($ENV{REDIS_SERVER} =~ m!^unix:(.+)!) {  | 
| 
147
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $args{sock} = $1;  | 
| 
148
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
149
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     elsif ($ENV{REDIS_SERVER} =~ m!^(tcp:)?(.+)!) {  | 
| 
150
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $args{server} = $2;  | 
| 
151
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
152
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
153
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
154
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
764
 | 
   my $on_conn = $args{on_connect};  | 
| 
155
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
201
 | 
   my $password = $args{password};  | 
| 
156
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
747
 | 
   my $name = $args{name};  | 
| 
157
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
723
 | 
   $self->__set_on_connect($self->_new_on_connect_cb($on_conn, $password, $name));  | 
| 
158
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   $self->__set_data({  | 
| 
159
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       subscribers => {},  | 
| 
160
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       sentinels_cnx_timeout    => $args{sentinels_cnx_timeout},  | 
| 
161
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       sentinels_read_timeout   => $args{sentinels_read_timeout},  | 
| 
162
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       sentinels_write_timeout  => $args{sentinels_write_timeout},  | 
| 
163
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       no_sentinels_list_update => $args{no_sentinels_list_update},  | 
| 
164
 | 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2023
 | 
   });  | 
| 
165
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
166
 | 
70
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
346
 | 
   if ($args{sock}) {  | 
| 
 
 | 
 
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
167
 | 
66
 | 
 
 | 
 
 | 
 
 | 
 
 | 
917
 | 
       $self->__connection_info_unix($args{sock});  | 
| 
168
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   } elsif ($args{sentinels}) {  | 
| 
169
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       my $sentinels = $args{sentinels};  | 
| 
170
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       ref $sentinels eq 'ARRAY'  | 
| 
171
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           or croak("'sentinels' param must be an ArrayRef");  | 
| 
172
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       defined($self->__get_data->{service} = $args{service})  | 
| 
173
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           or croak("Need 'service' name when using 'sentinels'!");  | 
| 
174
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $self->__get_data->{sentinels} = $sentinels;  | 
| 
175
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       my $on_build_sock = sub {  | 
| 
176
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
           my $data = $self->__get_data;  | 
| 
177
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           my $sentinels = $data->{sentinels};  | 
| 
178
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
179
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           # try to connect to a sentinel  | 
| 
180
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           my $status;  | 
| 
181
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           foreach my $sentinel_address (@$sentinels) {  | 
| 
182
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
               my $sentinel = eval {  | 
| 
183
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                   Redis::Fast::Sentinel->new(  | 
| 
184
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       server => $sentinel_address,  | 
| 
185
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       cnx_timeout   => (   exists $data->{sentinels_cnx_timeout}  | 
| 
186
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                                                ? $data->{sentinels_cnx_timeout}   : 0.1),  | 
| 
187
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       read_timeout  => (   exists $data->{sentinels_read_timeout}  | 
| 
188
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                                                ? $data->{sentinels_read_timeout}  : 1  ),  | 
| 
189
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       write_timeout => (   exists $data->{sentinels_write_timeout}  | 
| 
190
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                                                ? $data->{sentinels_write_timeout} : 1  ),  | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
191
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                   )  | 
| 
192
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               } or next;  | 
| 
193
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
               my $server_address = $sentinel->get_service_address($data->{service});  | 
| 
194
 | 
  
0
  
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
               defined $server_address  | 
| 
195
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 or $status ||= "Sentinels don't know this service",  | 
| 
196
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                    next;  | 
| 
197
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
               $server_address eq 'IDONTKNOW'  | 
| 
198
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 and $status = "service is configured in one Sentinel, but was never reached",  | 
| 
199
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                     next;  | 
| 
200
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
201
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               # we found the service, set the server  | 
| 
202
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
               my ($server, $port) = _split_host_port $server_address;  | 
| 
203
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
               $self->__connection_info($server, $port);  | 
| 
204
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
205
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
               if (! $data->{no_sentinels_list_update} ) {  | 
| 
206
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                   # move the elected sentinel at the front of the list and add  | 
| 
207
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                   # additional sentinels  | 
| 
208
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                   my $idx = 2;  | 
| 
209
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                   my %h = ( ( map { $_ => $idx++ } @{$data->{sentinels}}),  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
210
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                             $sentinel_address => 1,  | 
| 
211
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                           );  | 
| 
212
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
213
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                   $data->{sentinels} = [  | 
| 
214
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                       ( sort { $h{$a} <=> $h{$b} } CORE::keys(%h) ), # sorted existing sentinels,  | 
| 
215
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                       grep { ! $h{$_}; }                      # list of unknown  | 
| 
216
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       map {  | 
| 
217
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                           my $s = +{ @$_ };  | 
| 
218
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                           _join_host_port($s->{ip}, $s->{port});  | 
| 
219
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       }                                       # ip:port of  | 
| 
220
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       $sentinel->sentinel(                    # sentinels  | 
| 
221
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                         sentinels => $data->{service}         # for this service  | 
| 
222
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                       )  | 
| 
223
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                   ];  | 
| 
224
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               }  | 
| 
225
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           }  | 
| 
226
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       };  | 
| 
227
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $self->__set_on_build_sock($on_build_sock);  | 
| 
228
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   } else {  | 
| 
229
 | 
4
 | 
 
 | 
  
 50
  
 | 
 
 | 
 
 | 
67
 | 
       my ($server, $port) = _split_host_port($args{server} || '127.0.0.1:6379');  | 
| 
230
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
43
 | 
       $self->__connection_info($server, $port);  | 
| 
231
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
232
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
233
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   #$self->{is_subscriber} = 0;  | 
| 
234
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   #$self->{subscribers}   = {};  | 
| 
235
 | 
70
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
539
 | 
   $self->__set_reconnect($args{reconnect} || 0);  | 
| 
236
 | 
70
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
1376
 | 
   $self->__set_every($args{every} || 1000);  | 
| 
237
 | 
70
 | 
  
 50
  
 | 
  
 33
  
 | 
 
 | 
 
 | 
666
 | 
   $self->__set_debug(($args{debug} || $ENV{REDIS_DEBUG}) ? 1 : 0);  | 
| 
238
 | 
70
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
1111
 | 
   $self->__set_cnx_timeout($args{cnx_timeout} || -1);  | 
| 
239
 | 
70
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
734
 | 
   $self->__set_read_timeout($args{read_timeout} || -1);  | 
| 
240
 | 
70
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
396
 | 
   $self->__set_write_timeout($args{write_timeout} || -1);  | 
| 
241
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
242
 | 
70
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
854
 | 
   if (my $cb = $self->_new_reconnect_on_error_cb($args{reconnect_on_error})) {  | 
| 
243
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $self->__set_reconnect_on_error($cb);  | 
| 
244
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
245
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
246
 | 
70
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
465331
 | 
   $self->connect unless $args{no_auto_connect_on_new};  | 
| 
247
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
248
 | 
69
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3152
 | 
   return $self;  | 
| 
249
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
250
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
251
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
252
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
253
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ### Deal with common, general case, Redis commands  | 
| 
254
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our $AUTOLOAD;  | 
| 
255
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
256
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub AUTOLOAD {  | 
| 
257
 | 
13
 | 
 
 | 
 
 | 
  
13
  
 | 
 
 | 
3594
 | 
   my $command = $AUTOLOAD;  | 
| 
258
 | 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
279
 | 
   $command =~ s/.*://;  | 
| 
259
 | 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
131
 | 
   my @command = split /_/, uc $command;  | 
| 
260
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
261
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my $method = sub {  | 
| 
262
 | 
68
 | 
 
 | 
 
 | 
  
68
  
 | 
 
 | 
2105
 | 
       my $self = shift;  | 
| 
263
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
950
 | 
       $self->__is_valid_command($command);  | 
| 
264
 | 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1240066
 | 
       my ($ret, $error) = $self->__std_cmd(@command, @_);  | 
| 
265
 | 
68
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
12558
 | 
       confess "[$command] $error, " if defined $error;  | 
| 
266
 | 
54
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
1739
 | 
       return (wantarray && ref $ret eq 'ARRAY') ? @$ret : $ret;  | 
| 
267
 | 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
292
 | 
   };  | 
| 
268
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
269
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   # Save this method for future calls  | 
| 
270
 | 
38
 | 
 
 | 
 
 | 
  
38
  
 | 
 
 | 
344
 | 
   no strict 'refs';  | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
101
 | 
    | 
| 
 
 | 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
57106
 | 
    | 
| 
271
 | 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
405
 | 
   *$AUTOLOAD = $method;  | 
| 
272
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
273
 | 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
143
 | 
   goto $method;  | 
| 
274
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
275
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
276
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __with_reconnect {  | 
| 
277
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
   my ($self, $cb) = @_;  | 
| 
278
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
279
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   confess "not implemented";  | 
| 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
281
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
282
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
283
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ### Commands with extra logic  | 
| 
284
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
285
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub keys {  | 
| 
286
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $self = shift;  | 
| 
287
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__is_valid_command('keys');  | 
| 
288
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($ret, $error) = $self->__keys(@_);  | 
| 
289
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     confess "[keys] $error, " if defined $error;  | 
| 
290
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $ret unless ref $ret eq 'ARRAY';  | 
| 
291
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return @$ret;  | 
| 
292
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
293
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
294
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub ping {  | 
| 
295
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $self = shift;  | 
| 
296
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__is_valid_command('ping');  | 
| 
297
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return unless $self->__sock;  | 
| 
298
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return scalar try {  | 
| 
299
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
         my ($ret, $error) = $self->__std_cmd('ping');  | 
| 
300
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         return if defined $error;  | 
| 
301
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         return $ret;  | 
| 
302
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     } catch {  | 
| 
303
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
         return ;  | 
| 
304
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     };  | 
| 
305
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
306
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
307
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub info {  | 
| 
308
 | 
3
 | 
 
 | 
 
 | 
  
3
  
 | 
  
0
  
 | 
125
 | 
     my $self = shift;  | 
| 
309
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10
 | 
     $self->__is_valid_command('info');  | 
| 
310
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14
 | 
     my ($ret, $error) = $self->__info(@_);  | 
| 
311
 | 
3
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
349
 | 
     confess "[info] $error, " if defined $error;  | 
| 
312
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $ret unless ref $ret eq 'ARRAY';  | 
| 
313
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return @$ret;  | 
| 
314
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
315
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
316
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub quit {  | 
| 
317
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $self = shift;  | 
| 
318
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__is_valid_command('quit');  | 
| 
319
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__quit(@_);  | 
| 
320
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
321
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
322
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub shutdown {  | 
| 
323
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $self = shift;  | 
| 
324
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__is_valid_command('shutdown');  | 
| 
325
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__shutdown(@_);  | 
| 
326
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
327
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
328
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub select {  | 
| 
329
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my $self = shift;  | 
| 
330
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $database = shift;  | 
| 
331
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $self->__is_valid_command('select');  | 
| 
332
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($ret, $error) = $self->__std_cmd('SELECT', $database, @_);  | 
| 
333
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   confess "[SELECT] $error, " if defined $error;  | 
| 
334
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $self->__get_data->{current_database} = $database;  | 
| 
335
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return $ret;  | 
| 
336
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
337
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
338
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __subscription_cmd {  | 
| 
339
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
   my $self    = shift;  | 
| 
340
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $pr      = shift;  | 
| 
341
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $unsub   = shift;  | 
| 
342
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $command = shift;  | 
| 
343
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $cb      = pop;  | 
| 
344
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   weaken $self;  | 
| 
345
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
346
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   confess("Missing required callback in call to $command(), ")  | 
| 
347
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     unless ref($cb) eq 'CODE';  | 
| 
348
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
349
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $self->wait_all_responses;  | 
| 
350
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
351
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   while($self->__get_data->{cbs}) {  | 
| 
352
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $self->__wait_for_event(1);  | 
| 
353
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
354
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
355
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @subs = @_;  | 
| 
356
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   @subs = $self->__process_unsubscribe_requests($cb, $pr, @subs)  | 
| 
357
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if $unsub;  | 
| 
358
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
359
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if(@subs) {  | 
| 
360
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $self->__get_data->{cbs} = { map { ("${pr}message:$_" => $cb) } @subs };  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
361
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       for my $sub(@subs) {  | 
| 
362
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           $self->__send_subscription_cmd(  | 
| 
363
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               $command,  | 
| 
364
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               $sub,  | 
| 
365
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               $self->__subscription_callbak,  | 
| 
366
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           );  | 
| 
367
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }  | 
| 
368
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       while($self->__get_data->{cbs}) {  | 
| 
369
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           $self->__wait_for_event(1);  | 
| 
370
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }  | 
| 
371
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
372
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
373
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
374
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __subscription_callbak {  | 
| 
375
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
     my $self = shift;  | 
| 
376
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $cb = $self->__get_data->{callback};  | 
| 
377
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $cb if $cb;  | 
| 
378
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
379
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     weaken $self;  | 
| 
380
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     $cb = sub {  | 
| 
381
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
         my $cbs = $self->__get_data->{cbs};  | 
| 
382
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         if($cbs) {  | 
| 
383
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             $self->__process_subscription_changes($cbs, @_);  | 
| 
384
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             unless(%$cbs) {  | 
| 
385
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 $self->__get_data->{cbs} = undef;  | 
| 
386
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             }  | 
| 
387
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         } else {  | 
| 
388
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             $self->__process_pubsub_msg(@_);  | 
| 
389
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
390
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     };  | 
| 
391
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
392
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__get_data->{callback} = $cb;  | 
| 
393
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $cb;  | 
| 
394
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
395
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
396
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
 sub subscribe    { shift->__subscription_cmd('',  0, subscribe    => @_) }  | 
| 
397
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
 sub psubscribe   { shift->__subscription_cmd('p', 0, psubscribe   => @_) }  | 
| 
398
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
 sub unsubscribe  { shift->__subscription_cmd('',  1, unsubscribe  => @_) }  | 
| 
399
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
 sub punsubscribe { shift->__subscription_cmd('p', 1, punsubscribe => @_) }  | 
| 
400
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
401
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __process_unsubscribe_requests {  | 
| 
402
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
   my ($self, $cb, $pr, @unsubs) = @_;  | 
| 
403
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $subs = $self->__get_data->{subscribers};  | 
| 
404
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
405
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @subs_to_unsubscribe;  | 
| 
406
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   for my $sub (@unsubs) {  | 
| 
407
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $key = "${pr}message:$sub";  | 
| 
408
 | 
  
0
  
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     next unless $subs->{$key} && @{ $subs->{$key} };  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
409
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $cbs = $subs->{$key} = [grep { $_ ne $cb } @{ $subs->{$key} }];  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
410
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     next if @$cbs;  | 
| 
411
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
412
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     delete $subs->{$key};  | 
| 
413
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     push @subs_to_unsubscribe, $sub;  | 
| 
414
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
415
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return @subs_to_unsubscribe;  | 
| 
416
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
417
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
418
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __process_subscription_changes {  | 
| 
419
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
   my ($self, $expected, $m, $error) = @_;  | 
| 
420
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $subs = $self->__get_data->{subscribers};  | 
| 
421
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
422
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ## Deal with pending PUBLISH'ed messages  | 
| 
423
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($m->[0] =~ /^p?message$/) {  | 
| 
424
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $self->__process_pubsub_msg($m);  | 
| 
425
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return ;  | 
| 
426
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
427
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
428
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($key, $unsub) = $m->[0] =~ m/^(p)?(un)?subscribe$/;  | 
| 
429
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $key .= "message:$m->[1]";  | 
| 
430
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $cb = delete $expected->{$key};  | 
| 
431
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
432
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   push @{ $subs->{$key} }, $cb unless $unsub;  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
433
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
434
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
435
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __process_pubsub_msg {  | 
| 
436
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
   my ($self, $m) = @_;  | 
| 
437
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $subs = $self->__get_data->{subscribers};  | 
| 
438
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
439
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $sub   = $m->[1];  | 
| 
440
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $cbid  = "$m->[0]:$sub";  | 
| 
441
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $data  = pop @$m;  | 
| 
442
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $topic = defined $m->[2] ? $m->[2] : $sub;  | 
| 
443
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
444
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if (!exists $subs->{$cbid}) {  | 
| 
445
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     warn "Message for topic '$topic' ($cbid) without expected callback, ";  | 
| 
446
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return 0;  | 
| 
447
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
448
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
449
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $_->($data, $topic, $sub) for @{ $subs->{$cbid} };  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
450
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
451
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return 1;  | 
| 
452
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
453
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
454
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
455
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __is_valid_command {  | 
| 
456
 | 
71
 | 
 
 | 
 
 | 
  
71
  
 | 
 
 | 
323
 | 
   my ($self, $cmd) = @_;  | 
| 
457
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
458
 | 
71
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
469
 | 
   confess("Cannot use command '$cmd' while in SUBSCRIBE mode, ")  | 
| 
459
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     if $self->is_subscriber;  | 
| 
460
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
461
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
462
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;    # End of Redis.pm  | 
| 
463
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
464
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 __END__  |