<PackageReference Include="System.Reactive" Version="4.0.0" />

SubjectBase<T>

public abstract class SubjectBase<T> : ISubject<T>, ISubject<T, T>, IObserver<T>, IObservable<T>, IDisposable
Base class for objects that are both an observable sequence as well as an observer.
public abstract bool HasObservers { get; }

Indicates whether the subject has observers subscribed to it.

public abstract bool IsDisposed { get; }

Indicates whether the subject has been disposed.

protected SubjectBase()

public abstract void Dispose()

Releases all resources used by the current instance of the subject and unsubscribes all observers.

public abstract void OnCompleted()

Notifies all subscribed observers about the end of the sequence.

public abstract void OnError(Exception error)

Notifies all subscribed observers about the specified exception.

public abstract void OnNext(T value)

Notifies all subscribed observers about the arrival of the specified element in the sequence.

public abstract IDisposable Subscribe(IObserver<T> observer)

Subscribes an observer to the subject.