++ed by:
JACQUESG

1 PAUSE user

Jacques Germishuys

NAME

ZMQ::Raw::Poller - ZeroMQ Poller class

VERSION

version 0.04

DESCRIPTION

ZeroMQ Poller

SYNOPSIS

        use ZMQ::Raw;

        my $poller = ZMQ::Raw::Poller->new();
        $poller->add ($socket, ZMQ::Raw->ZMQ_POLLIN|ZMQ::Raw->ZMQ_POLLOUT);

        if ($poller->wait (1000))
        {
                my $events = $poller->events ($socket);
                if ($events & ZMQ::Raw->ZMQ_POLLIN)
                {
                        print "POLLIN event on $socket\n";
                }
        }

METHODS

new( )

Create a new poller.

add( $socket, $events )

Poll for $events on $socket. $events is a bitmask of values including:

  • ZMQ::Raw->ZMQ_POLLIN

    At least one message may be received from the socket without blocking.

  • ZMQ::Raw->ZMQ_POLLOUT

    At least one message may be sent to the socket without blocking.

events( $socket )

Retrieve the events for $socket. If $socket was not previously added to the poller this method will return undef.

wait ( $timeout )

Wait for up to $timeout milliseconds for an event. Returns the number of items that had events.

AUTHOR

Jacques Germishuys <jacquesg@striata.com>

LICENSE AND COPYRIGHT

Copyright 2017 Jacques Germishuys.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.