Skip to content

Instantly share code, notes, and snippets.

@jzawodn
Created September 7, 2012 23:23
Show Gist options
  • Save jzawodn/3670678 to your computer and use it in GitHub Desktop.
Save jzawodn/3670678 to your computer and use it in GitHub Desktop.
Testing for leaks in AnyEvent::Redis::Federated witout the poll() call
#!/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