Interface IStateObservable<TState>
A state-change source that can also deliver an immutable snapshot per fire. Prefer this overload for recording, replay, alerting, or any consumer that needs thread-safe reads of multiple fields (no torn reads across separate property gets).
public interface IStateObservable<TState> : IStateObservable where TState : struct
Type Parameters
TStateAn immutable snapshot type (typically a
readonly record struct).
- Inherited Members
Methods
SubscribeState(Action<TState>, StateRate)
Subscribe to state-change notifications at the given rate. The handler may run on any thread; consumers needing UI-thread marshalling must do it themselves.
StateSubscription SubscribeState(Action<TState> handler, StateRate rate)
Parameters
handlerAction<TState>Receives an immutable snapshot on each delivery.
rateStateRateDelivery rate — see StateRate.
Returns
- StateSubscription
A handle whose Dispose() unsubscribes.