Start an _RttMonitor that periodically runs ping.
(self)
| 180 | context.cancel() |
| 181 | |
| 182 | async def _start_rtt_monitor(self) -> None: |
| 183 | """Start an _RttMonitor that periodically runs ping.""" |
| 184 | # If this monitor is closed directly before (or during) this open() |
| 185 | # call, the _RttMonitor will not be closed. Checking if this monitor |
| 186 | # was closed directly after resolves the race. |
| 187 | self._rtt_monitor.open() |
| 188 | if self._executor._stopped: |
| 189 | await self._rtt_monitor.close() |
| 190 | |
| 191 | def gc_safe_close(self) -> None: |
| 192 | self._executor.close() |