def add_callback(self, callback): self._callbacks.add(stack_context.wrap(callback)) self._wake()
def add_handler(self, fd, handler, events): self._handlers[fd] = stack_context.wrap(handler) self._impl.register(fd, events | self.ERROR)
def add_timeout(self, deadline, callback): timeout = _Timeout(deadline, stack_context.wrap(callback)) bisect.insort(self._timeouts, timeout) return timeout