NAME

ZMQ::AnyEvent - Easy construction and use of asynchronous ZeroMQ sockets

VERSION

version 0.001

SYNOPSIS

use AnyEvent;
use ZMQ::AnyEvent;

my $cv = AE::cv;
my $sub = zmq_ae_sub 'ipc:///var/tmp/publisher', sub { $cv->send (@_) };
my $pub = zmq_ae_pub 'ipc:///var/tmp/publisher';
AE::postpone {$pub->send ('sending', 'a', 'multipart', 'message')}
print $cv->recv;

DESCRIPTION

ZMQ::AnyEvent is an attempt to find the middle-ground between AnyEvent::Handle::ZeroMQ, which is a thin shim over ZeroMQ and still makes you do a lot of work yourself (and be aware of the vagaries of the different sockets), and AnyEvent::ZeroMQ which tries to do it all (and makes it hard for you to do things like, say, send multipart messages).

It consists of several modules, corresponding to the different socket type ZeroMQ offers for implementing certain patterns:

Request-Reply Pattern

ZMQ::AnyEvent::REQ
ZMQ::AnyEvent::REP
ZMQ::AnyEvent::DEALER
ZMQ::AnyEvent::ROUTER

Publish-Subscribe Pattern

ZMQ::AnyEvent::PUB
ZMQ::AnyEvent::SUB

Pipeline Pattern

ZMQ::AnyEvent::PUSH
ZMQ::AnyEvent::PULL

While you may directly instantiate the various ZMQ::AnyEvent subclasses directly, it's really preferred that you use the factory functions in ZMQ::AE

AUTHOR

Michael Alan Dorman <mdorman@ironicdesign.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Ironic Design, Inc..

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.