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

ReactiveUI.Primitives.Advanced.SerializedWitness<T>

public sealed class SerializedWitness<T> : IObserver<T>
Wraps an observer so notifications from any number of threads reach it one at a time, without holding a lock while it runs.
public bool IsTerminated { get; }

Gets a value indicating whether the terminal notification has been taken for delivery.

public SerializedWitness(IObserver<T> observer)

Initializes a new instance of the SerializedWitness<T> class.

public void DeliverClaimed(T value)

Delivers a value on a claimed delivery, then drains anything queued meanwhile.

public void DeliverClaimed(T[] values)

Delivers values in order on a claimed delivery, then drains anything queued meanwhile.

public void Flush()

Delivers queued notifications on the calling thread, or hands them to the thread already delivering.

public void OnCompleted()

public void OnError(Exception error)

public void OnNext(T value)

public bool Post(T value)

Queues a value without delivering it.

public bool PostCompleted()

Queues completion as the terminal notification without delivering it.

public bool PostError(Exception error)

Queues an error as the terminal notification without delivering it.

public bool TryClaim()

Claims delivery when nothing is queued or delivering; safe under the caller's lock.