core.poll — PyZMQ v2.1.1dev documentation

### Navigation

- index
- modules |
- next |
- previous |
- home|
- search|
- API »
- The PyZMQ API »

# core.poll

## Module: `core.poll`

Inheritance diagram for `zmq.core.poll`:

0MQ polling related functions and classes.

## `Poller`

class `zmq.core.poll.` `Poller`

  Bases: `object`

  A stateful poll interface that mirrors Python’s built-in poll.

  `modify`(socket, flags=POLLIN|POLLOUT)

    Modify the flags for an already registered 0MQ socket or native fd.

  `poll`(timeout=None)

    Poll the registered 0MQ or native fds for I/O.

    Parameters : | timeout : float, int The timeout in milliseconds. If None, no timeout (infinite). This is in milliseconds to be compatible with `select.poll()`. The underlying zmq_poll uses microseconds and we convert to that in this function.

  `register`(socket, flags=POLLIN|POLLOUT)

    Register a 0MQ socket or native fd for I/O monitoring.

    Parameters : | socket : zmq.Socket or native socket A zmq.Socket or any Python object having a `fileno()` method that returns a valid file descriptor. flags : int The events to watch for. Can be POLLIN, POLLOUT or POLLIN|POLLOUT.

  `unregister`(socket)

    Remove a 0MQ socket or native fd for I/O monitoring.

    Parameters : | socket : Socket The socket instance to stop polling.

`zmq.core.poll.` `select`(rlist, wlist, xlist, timeout=None) -> (rlist, wlist, xlist)

  Return the result of poll as a lists of sockets ready for r/w/exception.

  This has the same interface as Python’s built-in `select.select()` function.

  Parameters : | timeout : float, int, optional The timeout in seconds. If None, no timeout (infinite). This is in seconds to be compatible with `select.select()`. The underlying zmq_poll uses microseconds and we convert to that in this function. rlist : list of sockets/FDs sockets/FDs to be polled for read events wlist : list of sockets/FDs sockets/FDs to be polled for write events xlist : list of sockets/FDs sockets/FDs to be polled for error events
  Returns : | (rlist, wlist, xlist) : tuple of lists of sockets (length 3) Lists correspond to sockets available for read/write/error events respectively.

### Navigation

- index
- modules |
- next |
- previous |
- home|
- search|
- API »
- The PyZMQ API »