ReadonlySessionStream of session lifecycle events from whatever adapter is currently
registered. Subscribers see only events that occur AFTER they subscribe —
SessionsObserver does not replay history (use RealtimeSessionReviewService
for past-session loading, separate concern).
The currently registered adapter. Provided for diagnostics; consumers
should subscribe to SessionLifecycle$ instead of reaching into the
adapter directly.
Whether a non-default adapter is currently registered. Useful for diagnostics ("are sessions actually wired up on this host?") and for features that should gate themselves on real wiring.
Tear down the adapter subscription and complete the lifecycle stream.
Safe to call multiple times. After Dispose, subscribers will receive a
complete notification on SessionLifecycle$.
Register the adapter that produces session events. Replaces any prior
adapter and cleanly tears down the previous subscription. Typically called
once at host bootstrap (e.g., Angular's ConversationsRuntimeBootstrap),
but multiple swaps are supported (e.g., test harnesses that switch
adapters between cases).
Observes Sessions/Channels lifecycle from the registered adapter and re-broadcasts via
SessionLifecycle$.Lifecycle: constructed once by
ConversationsRuntime(singleton). Stays subscribed to the adapter's stream untilDispose()is called. Adapter swaps viaUseSessionsAdapterunsubscribe the prior adapter cleanly.Usually accessed via
ConversationsRuntime.Instance.Sessions.