()
| 74 | # We strongly reference the executor and it weakly references us via |
| 75 | # this closure. When the monitor is freed, stop the executor soon. |
| 76 | def target() -> bool: |
| 77 | monitor = self_ref() |
| 78 | if monitor is None: |
| 79 | return False # Stop the executor. |
| 80 | monitor._run() # type:ignore[attr-defined] |
| 81 | return True |
| 82 | |
| 83 | executor = periodic_executor.PeriodicExecutor( |
| 84 | interval=interval, min_interval=min_interval, target=target, name=name |