(self)
| 123 | return AsyncioTimer(timeout, callback, loop=cls._loop) |
| 124 | |
| 125 | def close(self): |
| 126 | with self.lock: |
| 127 | if self.is_closed: |
| 128 | return |
| 129 | self.is_closed = True |
| 130 | |
| 131 | # close from the loop thread to avoid races when removing file |
| 132 | # descriptors |
| 133 | asyncio.run_coroutine_threadsafe( |
| 134 | self._close(), loop=self._loop |
| 135 | ) |
| 136 | |
| 137 | async def _close(self): |
| 138 | log.debug("Closing connection (%s) to %s" % (id(self), self.endpoint)) |
no test coverage detected