Added rough subscriber code that works, lots of open issues

Signed-off-by: Pedro Melo <melo@simplicidade.org>
This commit is contained in:
Pedro Melo
2014-07-20 10:27:43 +01:00
parent ceb8146410
commit 9521132b8b
3 changed files with 459 additions and 0 deletions

28
t/10-reader.t Executable file
View File

@@ -0,0 +1,28 @@
#!perl
use strict;
use warnings;
use Test::More;
use AnyEvent;
use AnyEvent::NSQ::Reader;
subtest 'basic connection' => sub {
my $r = AnyEvent::NSQ::Reader->new(
topic => 'test',
channel => 'anyevent-nsq-reader-test',
nsqd_tcp_addresses => '127.0.0.1',
client_id => "10-reader.t/$$",
ready_count => 5,
message_cb => sub {
print STDERR "!!!! GOT MESSAGE '$_[1]{message}\n";
return;
},
);
AE::cv->recv;
};
done_testing();