(self)
| 41 | return self._submit(coro).result() |
| 42 | |
| 43 | def close(self): |
| 44 | if self._closed: |
| 45 | return |
| 46 | |
| 47 | try: |
| 48 | if hasattr(self, "_async") and hasattr(self._async, "engine"): |
| 49 | self._run(self._async.engine.dispose()) |
| 50 | finally: |
| 51 | if self._loop and not self._loop.is_closed(): |
| 52 | self._loop.call_soon_threadsafe(self._loop.stop) |
| 53 | self._thread.join(timeout=5) |
| 54 | self._loop.close() |
| 55 | self._closed = True |
| 56 | |
| 57 | def __del__(self): |
| 58 | try: |