class_docstr: A stateful poll interface that mirrors Python's built-in poll.
class_docstr_tok: ["A","stateful","poll","interface","that","mirrors","Python","'s","built-in","poll","."]
docstr: Poll the registered 0MQ or native fds for I/O.
  
  If there are currently events ready to be processed, this function will return immediately.
  Otherwise, this function will return as soon the first event is available or after timeout
  milliseconds have elapsed.
  
  Parameters
  ----------
  timeout : int
      The timeout in milliseconds. If None, no `timeout` (infinite). This
      is in milliseconds to be compatible with ``select.poll()``.
  
  Returns
  -------
  events : list of tuples
      The list of events that are ready to be processed.
      This is a list of tuples of the form ``(socket, event_mask)``, where the 0MQ Socket
      or integer fd is the first element, and the poll event mask (POLLIN, POLLOUT) is the second.
      It is common to call ``events = dict(poller.poll())``,
      which turns the list of tuples into a mapping of ``socket : event_mask``.
docstr_tok: ["Poll","the","registered","0MQ","or","native","fds","for","I\/O",".","If","there","are","currently","events","ready","to","be","processed",",","this","function","will","return","immediately",".","Otherwise",",","this","function","will","return","as","soon","the","first","event","is","available","or","after","timeout","milliseconds","have","elapsed",".","Parameters","--","--","--","--","--","timeout",":","int","The","timeout","in","milliseconds",".","If","None",",","no","`","timeout","`","(","infinite",")",".","This","is","in","milliseconds","to","be","compatible","with","``","select.poll","(",")","``",".","Returns","--","--","--","-","events",":","list","of","tuples","The","list","of","events","that","are","ready","to","be","processed",".","This","is","a","list","of","tuples","of","the","form","``","(","socket",",","event_mask",")","``",",","where","the","0MQ","Socket","or","integer","fd","is","the","first","element",",","and","the","poll","event","mask","(","POLLIN",",","POLLOUT",")","is","the","second",".","It","is","common","to","call","``","events","=","dict","(","poller.poll","(",")",")","``",",","which","turns","the","list","of","tuples","into","a","mapping","of","``","socket",":","event_mask","``","."]
code: def poll(
      self, timeout: Optional[int] = None
  ) -> List[Tuple[Any, int]]:
      """Poll the registered 0MQ or native fds for I/O.
  
      If there are currently events ready to be processed, this function will return immediately.
      Otherwise, this function will return as soon the first event is available or after timeout
      milliseconds have elapsed.
  
      Parameters
      ----------
      timeout : int
          The timeout in milliseconds. If None, no `timeout` (infinite). This
          is in milliseconds to be compatible with ``select.poll()``.
  
      Returns
      -------
      events : list of tuples
          The list of events that are ready to be processed.
          This is a list of tuples of the form ``(socket, event_mask)``, where the 0MQ Socket
          or integer fd is the first element, and the poll event mask (POLLIN, POLLOUT) is the second.
          It is common to call ``events = dict(poller.poll())``,
          which turns the list of tuples into a mapping of ``socket : event_mask``.
      """
      if timeout is None or timeout < 0:
          timeout = -1
      elif isinstance(timeout, float):
          timeout = int(timeout)
      return zmq_poll(self.sockets, timeout=timeout)
  
file_path: catboost/contrib/python/pyzmq/py3/zmq/sugar/poll.py
imports: from typing import Any, Dict, List, Optional, Tuple
  from zmq.backend import zmq_poll
  from zmq.constants import POLLERR, POLLIN, POLLOUT
label_desc: Use image node_id 6 for calling the Poller obj's underlying member method code with example usage: obj.poll(timeout) and returns: zmq_poll