Hi Pieter, I followed the Ruby FFI model and added a separate page 'Perl (FFI)'
Thanks, Dylan On Mon, Oct 7, 2013 at 3:14 AM, Pieter Hintjens <[email protected]> wrote: > Hi Thomas (Dylan too), > > You can update the Perl binding page to include your project, or > create a new page for it on the wiki. http://zeromq.org/bindings:perl > > -Pieter > > On Mon, Oct 7, 2013 at 9:29 AM, Thomas Klausner <[email protected]> wrote: > > Hi! > > > > Sort of in reaction to Dylan Calis post about ZMQ::FFI I'm finally > > announcing our high-level ZeroMQ Perl wrapper: > > > > https://metacpan.org/module/ZMQx::Class > > https://github.com/domm/ZMQx-Class > > > > It's using ZMQ::LibZMQ3 and Moose, key features are: > > * Easy setup of sockets > > * Easy setting & getting of sockopts > > * Easy sending & receiving of single- and multipart messages > > * Fork / Context handling > > * AnyEvent helpers > > > > > > Here's an example publisher: > > > > use ZMQx::Class; > > use Time::HiRes qw(usleep); > > > > my $publisher = ZMQx::Class->socket( 'PUB', bind => 'tcp://*:10000' ); > > > > while ( 1 ) { > > my $random = int( rand ( 10_000 ) ); > > say "sending $random hello"; > > $publisher->send( [ $random, 'hello' ] ); > > usleep(1000); > > } > > > > > > and here a matching subscriber: > > > > > > use ZMQx::Class; > > use Anyevent; > > > > my $subscriber = ZMQx::Class->socket( 'SUB', connect => > 'tcp://localhost:10000' ); > > $subscriber->subscribe( '1' ); > > > > my $watcher = $subscriber->anyevent_watcher( sub { > > while ( my $msg = $subscriber->receive ) { > > say "got $msg->[0] saying $msg->[1]"; > > } > > }); > > AnyEvent->condvar->recv; > > > > > > Any Feedback is welcome! > > > > Greetings, > > domm > > > > > > -- > > #!/usr/bin/perl http://domm.plix.at > > for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/} > > _______________________________________________ > > zeromq-dev mailing list > > [email protected] > > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev >
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
