<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.
public SynchronizeWitness(IObserver<T> observer)

Initializes a new instance of the SynchronizeWitness<T> class with a private gate.

public SynchronizeWitness(IObserver<T> observer, Lock gate)

Initializes a new instance of the SynchronizeWitness<T> class sharing the supplied gate.

public void Dispose()

public void OnCompleted()

public void OnError(Exception error)

public void OnNext(T value)

public void SetSubscription(IDisposable subscription)

Assigns the upstream subscription, disposing it if one is already held.