implementation that sends progress reports to
Note that ObserverProgress
is in the Nito.AsyncEx.ObserverProgress.nuget package, and is installed as source into your target project.
also supports ObserveTaskForCompletion
, which will complete the event stream (via
) when the Task
// A progress implementation that sends progress reports to an observer stream.
// Optionally ends the stream when the task completes.
internal sealed class ObserverProgress<T> : IProgress<T>
// Initializes a new instance of the ObserverProgress<T> class.
public ObserverProgress(IObserver<T> observer);
// Watches the task, and completes the observer when the task completes.
public void ObserveTaskForCompletion(Task task);