MCPcopy Create free account
hub / github.com/EasyIME/PIME / close

Method close

python/python3/tornado/platform/asyncio.py:142–157  ·  view source on GitHub ↗
(self, all_fds: bool = False)

Source from the content-addressed store, hash-verified

140 super().initialize(**kwargs)
141
142 def close(self, all_fds: bool = False) -> None:
143 self.closing = True
144 for fd in list(self.handlers):
145 fileobj, handler_func = self.handlers[fd]
146 self.remove_handler(fd)
147 if all_fds:
148 self.close_fd(fileobj)
149 # Remove the mapping before closing the asyncio loop. If this
150 # happened in the other order, we could race against another
151 # initialize() call which would see the closed asyncio loop,
152 # assume it was closed from the asyncio side, and do this
153 # cleanup for us, leading to a KeyError.
154 del IOLoop._ioloop_for_asyncio[self.asyncio_loop]
155 if self.selector_loop is not self.asyncio_loop:
156 self.selector_loop.close()
157 self.asyncio_loop.close()
158
159 def add_handler(
160 self, fd: Union[int, _Selectable], handler: Callable[..., None], events: int

Callers

nothing calls this directly

Calls 4

remove_handlerMethod · 0.95
listFunction · 0.85
close_fdMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected