AnyEvent::Handle::ZeroMQ::Dealer - use AnyEvent::Handle::ZeroMQ as concurrent request-reply pattern
use AnyEvent::Handle::ZeroMQ::Dealer; use AE; use ZeroMQ; my $ctx = ZeroMQ::Context->new; my $socket = $ctx->socket(ZMQ_XREQ); $socket->bind('tcp://0:8888'); my $hdl = AnyEvent::Handle::ZeroMQ::Dealer->new( socket => $socket, on_drain => sub { print "the write queue is empty\n" }, ); # or $hdl->on_drain( sub { ... } ); my @request = ...; $hdl->push_write( \@request, sub { my($hdl, $reply) = @_; ... } ); AE::cv->recv;
Get an AnyEvent::Handle::ZeroMQ::Dealer instance
Don't use this.
To install AnyEvent::Handle::ZeroMQ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::Handle::ZeroMQ
CPAN shell
perl -MCPAN -e shell install AnyEvent::Handle::ZeroMQ
For more information on module installation, please visit the detailed CPAN module installation guide.