DESCRIPTION

Please note that this module has been DEPRECATED in favor of ZMQ::LibZMQ2, ZMQ::LibZMQ3, and ZMQ. see https://github.com/lestrrat/p5-ZMQ and other CPAN pages.

The ZeroMQ module is a wrapper of the 0MQ message passing library for Perl. It's a thin wrapper around the C API. Please read http://zeromq.org for more details on ZeroMQ.

CLASS WALKTHROUGH

ZeroMQ::Raw

Use ZeroMQ::Raw to get access to the C API such as zmq_init, zmq_socket, et al. Functions provided in this low level API should follow the C API exactly.

ZeroMQ::Constants

ZeroMQ::Constants contains all of the constants that are known to be extractable from zmq.h. Do note that sometimes the list changes due to additions/deprecations in the underlying zeromq2 library. We try to do our best to make things available (at least to warn you that some symbols are deprecated), but it may not always be possible.

SERIALIZATION

To serialize, use register_write_type() to register a name and an associated callback to serialize the data. For example, for JSON we do the following (this is already done for you in ZeroMQ.pm if you have JSON.pm installed):

device($type, $sock1, $sock2)

register_read_type($name, \&callback)

Register a read callback for a given $name. This is used in recv_as(). The callback receives the data received from the socket.

register_write_type($name, \&callback)

Register a write callback for a given $name. This is used in send_as() The callback receives the Perl structure given to send_as()

DEBUGGING XS

If you see segmentation faults, and such, you need to figure out where the error is occuring in order for the maintainers to figure out what happened. Here's a very very brief explanation of steps involved.

First, make sure to compile ZeroMQ.pm with debugging on by specifying -g:

perl Makefile.PL -g
make

Then fire gdb:

gdb perl
(gdb) R -Mblib /path/to/your/script.pl

When you see the crash, get a backtrace:

(gdb) bt

CAVEATS

This is an early release. Proceed with caution, please report (or better yet: fix) bugs you encounter.

This module has been tested againt zeromq 2.1.4. Semantics of this module rely heavily on the underlying zeromq version. Make sure you know which version of zeromq you're working with.

SEE ALSO

AUTHOR

Daisuke Maki <daisuke@endeworks.jp>

Steffen Mueller, <smueller@cpan.org>

COPYRIGHT AND LICENSE

The ZeroMQ module is

Copyright (C) 2010 by Daisuke Maki

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.

Module Install Instructions

To install ZeroMQ, simply copy and paste either of the commands in to your terminal