(self)
| 100 | self._notifier.send() |
| 101 | |
| 102 | def _run_loop(self): |
| 103 | while True: |
| 104 | self._loop.start() |
| 105 | # there are still active watchers, no deadlock |
| 106 | with self._lock: |
| 107 | if not self._shutdown and self._live_conns: |
| 108 | log.debug("Restarting event loop") |
| 109 | continue |
| 110 | else: |
| 111 | # all Connections have been closed, no active watchers |
| 112 | log.debug("All Connections currently closed, event loop ended") |
| 113 | self._started = False |
| 114 | break |
| 115 | |
| 116 | def _cleanup(self): |
| 117 | self._shutdown = True |