newPersistenceObserver returns an observer that persists to store, or nil when store is nil so the constructor can call [WithEventObserver] unconditionally without a guard.
(store session.Store)
| 48 | // nil when store is nil so the constructor can call [WithEventObserver] |
| 49 | // unconditionally without a guard. |
| 50 | func newPersistenceObserver(store session.Store) *PersistenceObserver { |
| 51 | if store == nil { |
| 52 | return nil |
| 53 | } |
| 54 | return &PersistenceObserver{store: store} |
| 55 | } |
| 56 | |
| 57 | // OnRunStart persists the session row before the run loop starts. |
| 58 | // Sub-sessions skip this: the parent session's store absorbs them via |
no outgoing calls