'Wait for events of interest on registered file descriptors until an
event of interest occurs or next timer deadline or _MAX_POLL_TIMEOUT,
whichever is sooner, and dispatch the corresponding event handlers.'

def poll(self):

    while True:
        try:
            events = self._poll.poll(self._get_next_deadline())
            break
        except _SELECT_ERRORS as error:
            if _is_resumable(error):
                continue
            else:
                raise
    fd_event_map = defaultdict(int)
    for (fileno, event) in events:
        fd_event_map[fileno] |= event
    self._dispatch_fd_events(fd_event_map)
