(cls)
| 95 | |
| 96 | @classmethod |
| 97 | def StopLoop(cls): |
| 98 | assert cls._loop is not None, "Loop is not started" |
| 99 | assert cls._thread is not None, "Thread is not started" |
| 100 | |
| 101 | def stop_loop(): |
| 102 | cls._logger.debug("Stopping the loop!") |
| 103 | cls._loop.stop() |
| 104 | |
| 105 | cls._logger.info("Waiting for remaining tasks to finish") |
| 106 | cls.WaitLoop() |
| 107 | |
| 108 | cls._loop.call_soon_threadsafe(stop_loop) |
| 109 | cls._thread.join() |
| 110 | |
| 111 | @classmethod |
| 112 | def GetLoop(cls) -> asyncio.AbstractEventLoop: |