(cls)
| 107 | |
| 108 | @classmethod |
| 109 | def StopLoop(cls): |
| 110 | assert cls._loop is not None, "Loop is not started" |
| 111 | assert cls._thread is not None, "Thread is not started" |
| 112 | |
| 113 | def stop_loop(): |
| 114 | cls._logger.debug("Stopping the loop!") |
| 115 | cls._loop.stop() |
| 116 | |
| 117 | cls._logger.info("Waiting for remaining tasks to finish") |
| 118 | cls.WaitLoop() |
| 119 | |
| 120 | cls._loop.call_soon_threadsafe(stop_loop) |
| 121 | cls._thread.join() |
| 122 | |
| 123 | @classmethod |
| 124 | def GetLoop(cls) -> asyncio.AbstractEventLoop: |