Created
September 7, 2012 23:23
-
-
Save jzawodn/3670678 to your computer and use it in GitHub Desktop.
Testing for leaks in AnyEvent::Redis::Federated witout the poll() call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use lib ('../lib','./lib'); | |
use Test::More tests => 1; | |
use AnyEvent; | |
use AnyEvent::Redis::Federated; | |
my %config = ( | |
'nodes' => { | |
redis_0 => { address => 'localhost:63790' }, | |
}, | |
); | |
# new client | |
my $redis = new AnyEvent::Redis::Federated( | |
config => \%config, | |
tag => 'default', | |
debug => 0, | |
); | |
ok($redis); | |
my $count = 0; | |
my $doit; | |
$doit = sub { | |
$redis->set("foo", "bar", sub { | |
$count++; | |
$doit->(); | |
}); | |
}; | |
$doit->(); | |
AnyEvent->condvar->recv; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment