Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:293465
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use Tatsumaki::MessageQueue;
 
my $channel = 'test1';
my $client_id = rand(1);
 
my $sub = Tatsumaki::MessageQueue->instance( $channel );
my $pub = Tatsumaki::MessageQueue->instance( $channel );
foreach(1 .. 10000){
$sub->poll_once($client_id, sub { });
$pub->publish({ data => 'hello' });
 
# Run main loop to avoid queueing.
my $cv = AE::cv;
my $t = AE::timer 0, 0, sub { $cv->send; };
$cv->recv;
 
warn `ps -o rss= -p $$` if $_ % 1000 == 0;
}
 
__END__
 
% perl -Ilib check_leek.pl
5360
5360
5360
5360
5360
5360
5360
5360
5360
5360
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.