def terminate(self):
if hasattr(self.cmd_write, 'getsockname'):
self.cmd_write.close()
self.cmd_read.close()
for fd in self._fds.values():
try:
self._poller.unregister(fd._fileno)
except:
logger.warning('unregister of %s failed with %s',
fd._fileno, traceback.format_exc())
fd._notifier = None
self._fds.clear()
self._timeouts = []
if hasattr(self._poller, 'terminate'):
self._poller.terminate()
self._poller = None
self.cmd_read = self.cmd_write = None
评论列表
文章目录