Initialize the event manager upon entering the async context.
(self)
| 102 | return self._active_ref_count > 0 |
| 103 | |
| 104 | async def __aenter__(self) -> EventManager: |
| 105 | """Initialize the event manager upon entering the async context.""" |
| 106 | self._active_ref_count += 1 |
| 107 | if self._active_ref_count > 1: |
| 108 | return self |
| 109 | |
| 110 | self._emit_persist_state_event_rec_task.start() |
| 111 | return self |
| 112 | |
| 113 | async def __aexit__( |
| 114 | self, |