Esempio n. 1
0
File: ioloop.py Progetto: recoyou/t3
 def add_timeout(self, deadline, callback):
     """Calls the given callback at the time deadline from the I/O loop."""
     timeout = _Timeout(deadline, stack_context.wrap(callback))
     bisect.insort(self._timeouts, timeout)
     return timeout
Esempio n. 2
0
File: ioloop.py Progetto: recoyou/t3
 def add_callback(self, callback):
     """Calls the given callback on the next I/O loop iteration."""
     self._callbacks.add(stack_context.wrap(callback))
     self._wake()
Esempio n. 3
0
File: ioloop.py Progetto: recoyou/t3
 def add_handler(self, fd, handler, events):
     """Registers the given handler to receive the given events for fd."""
     self._handlers[fd] = stack_context.wrap(handler)
     self._impl.register(fd, events | self.ERROR)