AnyEvent-Redis-RipeRedis

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
    is called in both cases: when operation was completed successfully and when
    some error occurred.
  - Improved POD.
  - Improved unit tests.
  - Another wave of refactoring.
 
1.254 Mon Jun 9 17:44:55 MSK 2013
  - Minor changes in POD.
 
1.253 Wed May 31 14:38:35 MSK 2013
  - BUGFIX: Fixed premature triggering of the 'rtimeout' timer in some cases.
 
1.252 Wed May 29 11:00:45 MSK 2013
  - BUGFIX: Fixed reading from the uninitialized read buffer in some cases.
  - Now, in tests empty TCP port is taken using module Net::EmptyPort.
 
1.251 Fri Apr 26 11:29:05 MSK 2013
  - Slight modification of examples in POD
 
1.250 Thu Apr 25 22:00:30 MSK 2013
  - Improved error handling for EXEC command and for Lua scripts, which returns

examples/subs.pl  view on Meta::CPAN

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
        print "Unsubscribed: $pattern. Remaining: $channels_num\n";
 
        if ( $channels_num == 0 ) {
          $cv->send();
        }
      },
    }
  );
 
  my $timer;
  $timer = AE::timer( 5, 0,
    sub {
      undef( $timer );
      exit 0; # Emergency exit
    },
  );
};
 
my $int_w = AE::signal( INT => $on_signal );
my $term_w = AE::signal( TERM => $on_signal );
 
$cv->recv();

examples/unix_socket.pl  view on Meta::CPAN

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  on_connect => sub {
    print "Connected to Redis server\n";
  },
 
  on_disconnect => sub {
    print "Disconnected from Redis server\n";
  },
);
 
my $timer;
$timer = AE::timer( 0, 1,
  sub {
    $redis->incr( 'foo',
      sub {
        my $data = shift;
 
        if ( @_ ) {
          my $err_msg = shift;
 
          warn $err_msg;

lib/AnyEvent/Redis/RipeRedis.pm  view on Meta::CPAN

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
  $self->{_lazy_conn_st}     = $params{lazy};
  $self->{_auth_st}          = S_NEED_PERFORM;
  $self->{_select_db_st}     = S_NEED_PERFORM;
  $self->{_ready_to_write}   = 0;
  $self->{_input_queue}      = [];
  $self->{_temp_queue}       = [];
  $self->{_processing_queue} = [];
  $self->{_txn_lock}         = 0;
  $self->{_channels}         = {};
  $self->{_channel_cnt}      = 0;
  $self->{_reconnect_timer}  = undef;
 
  unless ( $self->{_lazy_conn_st} ) {
    $self->_connect();
  }
 
  return $self;
}
 
sub multi {
  my $self = shift;

lib/AnyEvent/Redis/RipeRedis.pm  view on Meta::CPAN

609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
  }
}
elsif ( $self->{_lazy_conn_st} ) {
  $self->{_lazy_conn_st} = 0;
  $self->_connect();
}
elsif ( $self->{reconnect} ) {
  if ( defined $self->{min_reconnect_interval}
    && $self->{min_reconnect_interval} > 0 )
  {
    unless ( defined $self->{_reconnect_timer} ) {
      $self->{_reconnect_timer} = AE::timer( $self->{min_reconnect_interval}, 0,
        sub {
          undef $self->{_reconnect_timer};
          $self->_connect();
        }
      );
    }
  }
  else {
    $self->_connect();
  }
}
else {

t/07-lazy-conn.t  view on Meta::CPAN

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  host       => $SERVER_INFO->{host},
  port       => $SERVER_INFO->{port},
  lazy       => 1,
  reconnect  => 0,
 
  on_connect => sub {
    $T_IS_CONN = 1;
  },
);
 
my $timer;
$timer = AnyEvent->timer(
  after => 3,
  cb => sub {
    undef $timer;
 
    ok( !$T_IS_CONN, 'lazy connection (no connected yet)' );
 
    $REDIS->ping(
      { on_done => sub {
          $cv->send();
        },
      }
    );
  },

t/09-conn-errors.t  view on Meta::CPAN

223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
        $cv->send();
      },
      on_error => sub {
        $t_cli_err_msg  = shift;
        $t_cli_err_code = shift;
      },
    );
 
    $redis->ping(
      { on_done => sub {
          my $timer;
          $timer = AE::postpone(
            sub {
              undef $timer;
              $server_info->{server}->stop();
            }
          );
        },
      }
    );
  }
);
 
$server_info = run_redis_instance(

t/test_helper.pl  view on Meta::CPAN

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  };
}
 
sub ev_loop {
  my $sub = shift;
 
  my $cv = AE::cv();
 
  $sub->( $cv );
 
  my $timer = AE::timer( 10, 0,
    sub {
      diag( 'Emergency exit from event loop. Test failed' );
      $cv->send();
    }
  );
 
  $cv->recv();
 
  return;
}



( run in 0.313 second using v1.01-cache-2.11-cpan-26ccb49234f )