(self)
| 26 | return cls._instances[thread_name] |
| 27 | |
| 28 | def _start(self): |
| 29 | if not hasattr(self, "loop") or not self.loop: |
| 30 | self.loop = asyncio.new_event_loop() |
| 31 | if not hasattr(self, "thread") or not self.thread: |
| 32 | self.thread = threading.Thread( |
| 33 | target=self._run_event_loop, daemon=True, name=self.thread_name |
| 34 | ) |
| 35 | self.thread.start() |
| 36 | |
| 37 | def _run_event_loop(self): |
| 38 | if not self.loop: |
no test coverage detected