<PackageReference Include="ReactiveUI.Primitives" Version="7.3.0" />

ReactiveUI.Primitives.Advanced.GuardedWitness<T>

public sealed class GuardedWitness<T> : IObserver<T>, IDisposable
Forwarding observer that releases its upstream cancel resource when the sequence terminates or a downstream OnNext throws. The shared guard behind the scheduled factory signals (Empty, Return, Throw, Defer), usable by any signal implementation that needs terminate-and-release semantics around a downstream observer.
public GuardedWitness(IObserver<T> observer, IDisposable cancel)

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

public void Dispose()

public void OnCompleted()

public void OnError(Exception error)

public void OnNext(T value)