Skip Menu |

This queue is for tickets about the ZeroMQ CPAN distribution.

Report information
The Basics
Id: 78857
Status: open
Priority: 0/
Queue: ZeroMQ

People
Owner: Nobody in particular
Requestors: sonia [...] snowfrog.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: example for zmq_poll usage with ZeroMQ::Raw
Hi Daisuke, thank you for writing the ZeroMQ Perl library, I appreciate your work :-) Would you mind writing a quick example for how to use zmq_poll and ZeroMQ::Raw? In the documentation section "ASYNCHRONOUS I/O WITH ZEROMQ" you have described how to setup the zmq_poll hash with callbacks, but not the parameters passed to the callbacks or how to extract messages in the callbacks. I've tried reading thru the sourcecode in ZeroMQ- 0.21/lib/ZeroMQ/Poller.pm, but my Perl isn't good enough to deciper how you're using zmq_poll: 18 sub poll { ... 25 zmq_poll($self->_raw_poll_items, $timeout); 26 } Thanks, Sonia.
Please use ZMQ::LibZMQ2 ( or ZMQ::LibZMQ3 ). ZeroMQ was a good attempt, but differences between versions of libzmq makes it extremely hard for bindings to keep a sane API. for an example, see https://github.com/lestrrat/p5-ZMQ/blob/master/ZMQ- LibZMQ2/t/006_anyevent.t#L18-29 but if it's in Perl, I'd suggest using AnyEvent (example in the same file) p.s. LibZMQ3 is only on github at the moment
Subject: Re: [rt.cpan.org #78857] example for zmq_poll usage with ZeroMQ::Raw
Date: Thu, 09 Aug 2012 16:16:41 +1000
To: Daisuke Maki via RT <bug-ZeroMQ [...] rt.cpan.org>
From: Sonia Hamilton <sonia [...] snowfrog.net>
Thanks Daisuke, I'll check out versions 2 & 3. I was more interested in examples, but I worked it out anyway: sub master_callback { my $msg = zmq_msg_data(zmq_recv($master_ch)); Perhaps you should include an example like this in the doco? Sonia. Show quoted text
----- Original message ----- From: Daisuke Maki via RT <bug-ZeroMQ@rt.cpan.org> To: sonia@snowfrog.net Subject: [rt.cpan.org #78857] example for zmq_poll usage with ZeroMQ::Raw Date: Thu, 9 Aug 2012 01:41:19 -0400 <URL: https://rt.cpan.org/Ticket/Display.html?id=78857 > Please use ZMQ::LibZMQ2 ( or ZMQ::LibZMQ3 ). ZeroMQ was a good attempt, but differences between versions of libzmq makes it extremely hard for bindings to keep a sane API. for an example, see https://github.com/lestrrat/p5-ZMQ/blob/master/ZMQ- LibZMQ2/t/006_anyevent.t#L18-29 but if it's in Perl, I'd suggest using AnyEvent (example in the same file) p.s. LibZMQ3 is only on github at the moment
Show quoted text
> Perhaps you should include an example like this in the doco? > > Sonia.
Patches welcome :)