<PackageReference Include="ReactiveUI.Primitives.Core" Version="7.4.0" />

ReactiveUI.Primitives.Advanced.SynchronizeWitness<T>

public sealed class SynchronizeWitness<T> : IObserver<T>, IDisposable
Observer that serializes notifications behind a gate so downstream operators always observe the single-threaded OnNext* then OnError|OnCompleted grammar they depend on, even when the upstream source delivers concurrently. Stateful sinks (counting, distinct, buffering) rely on that grammar; placing one of these ahead of them is the supported way to consume a non-conformant source.
namespace ReactiveUI.Primitives.Advanced { public sealed class SynchronizeWitness<[Nullable(2)] T> : IObserver<T>, IDisposable { public SynchronizeWitness(IObserver<T> observer); public SynchronizeWitness(IObserver<T> observer, Lock gate); public void OnNext(T value); public void OnError(Exception error); public void OnCompleted(); public void SetSubscription(IDisposable subscription); public void Dispose(); } }