Observable.ToAsync<TSource> Method (Action<TSource>)

Converts the function into an asynchronous function.

Namespace:  System.Reactive.Linq
Assembly:  System.Reactive (in System.Reactive.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function ToAsync(Of TSource) ( _
    action As Action(Of TSource) _
) As Func(Of TSource, IObservable(Of Unit))
'Usage
Dim action As Action(Of TSource)
Dim returnValue As Func(Of TSource, IObservable(Of Unit))

returnValue = action.ToAsync()
public static Func<TSource, IObservable<Unit>> ToAsync<TSource>(
    this Action<TSource> action
)
[ExtensionAttribute]
public:
generic<typename TSource>
static Func<TSource, IObservable<Unit>^>^ ToAsync(
    Action<TSource>^ action
)
static member ToAsync : 
        action:Action<'TSource> -> Func<'TSource, IObservable<Unit>> 
JScript does not support generic types and methods.

Type Parameters

  • TSource
    The type of source.

Parameters

  • action
    Type: System.Action<TSource>
    The action used to synchronization.

Return Value

Type: System.Func<TSource, IObservable<Unit>>
The function into an asynchronous function.

Usage Note

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

See Also

Reference

Observable Class

ToAsync Overload

System.Reactive.Linq Namespace