(cls)
| 78 | |
| 79 | @classmethod |
| 80 | def StartLoop(cls): |
| 81 | if cls._loop is not None: |
| 82 | cls._logger.warning("Loop is already started") |
| 83 | return |
| 84 | |
| 85 | if cls._loop is None: |
| 86 | cls._loop = asyncio.new_event_loop() |
| 87 | |
| 88 | def run_loop(): |
| 89 | asyncio.set_event_loop(cls._loop) |
| 90 | cls._logger.debug("Starting the asyncio loop") |
| 91 | cls._loop.run_forever() |
| 92 | |
| 93 | cls._thread = threading.Thread(target=run_loop) |
| 94 | cls._thread.start() |
| 95 | |
| 96 | @classmethod |
| 97 | def StopLoop(cls): |