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

AsyncSubject<T>

public sealed class AsyncSubject<T> : SubjectBase<T>, INotifyCompletion
Represents the result of an asynchronous operation. The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
public bool IsCompleted { get; }

Gets whether the AsyncSubject has completed.

public AsyncSubject()

Creates a subject that can only receive one value and that value is cached for all future observations.

Gets an awaitable object for the current AsyncSubject.

public T GetResult()

Gets the last element of the subject, potentially blocking until the subject completes successfully or exceptionally.

public void OnCompleted(Action continuation)

Specifies a callback action that will be invoked when the subject completes.