def METHOD_NAME(self, max_delay):
    """Wait at most `max_delay` second, for available input (e.g. packet).
    If so, all associated callbacks are run until there is no input.
    """
    fd_list = list(sorted(self.fd_callback_table.keys()))
    while True:
        rlist, unused, unused = select.select(fd_list, [], [], max_delay)
        if len(rlist) == 0:
            break
        for fd in rlist:
            callback, args = self.fd_callback_table[fd]
            callback(*args)
        # note that sched impl. allows to return before sleeping `delay`