TaskObservableExtensions.ToObservable Method (Task)

Returns an observable sequence that signals when the task completes.

Namespace:  System.Reactive.Threading.Tasks
Assembly:  System.Reactive (in System.Reactive.dll)


<ExtensionAttribute> _
Public Shared Function ToObservable ( _
    task As Task _
) As IObservable(Of Unit)
Dim task As Task
Dim returnValue As IObservable(Of Unit)

returnValue = task.ToObservable()
public static IObservable<Unit> ToObservable(
    this Task task
static IObservable<Unit>^ ToObservable(
    Task^ task
static member ToObservable : 
        task:Task -> IObservable<Unit> 
public static function ToObservable(
    task : Task
) : IObservable<Unit>


Return Value

Type: System.IObservable<Unit>
An observable sequence that produces a unit value when the task completes, or propagates the exception produced by the task.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Task. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also


TaskObservableExtensions Class

ToObservable Overload

System.Reactive.Threading.Tasks Namespace