docstr: poll the socket for events
  
  returns a Future for the poll results.
docstr_tok: ["poll","the","socket","for","events","returns","a","Future","for","the","poll","results","."]
code: def poll(self, timeout=None, flags=_zmq.POLLIN):
      """poll the socket for events
  
      returns a Future for the poll results.
      """
  
      if self.closed:
          raise _zmq.ZMQError(_zmq.ENOTSUP)
  
      p = self._poller_class()
      p.register(self, flags)
      f = p.poll(timeout)
  
      future = self._Future()
  
      def unwrap_result(f):
          if future.done():
              return
          if f.cancelled():
              try:
                  future.cancel()
              except RuntimeError:
                  # RuntimeError may be called during teardown
                  pass
              return
          if f.exception():
              future.set_exception(f.exception())
          else:
              evts = dict(f.result())
              future.set_result(evts.get(self, 0))
  
      if f.done():
          # hook up result if
          unwrap_result(f)
      else:
          f.add_done_callback(unwrap_result)
      return future
  
imports: from collections import namedtuple, deque
  from itertools import chain
  from zmq import EVENTS, POLLOUT, POLLIN
  import zmq
label_desc: Use image node_id 10 for calling the _AsyncSocket obj's underlying member method code with example usage: obj.poll(timeout, flags) and returns: future