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

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), _
    scheduler As IScheduler _
) As Func(Of TSource, IObservable(Of Unit))
'Usage
Dim action As Action(Of TSource)
Dim scheduler As IScheduler
Dim returnValue As Func(Of TSource, IObservable(Of Unit))

returnValue = action.ToAsync(scheduler)
public static Func<TSource, IObservable<Unit>> ToAsync<TSource>(
    this Action<TSource> action,
    IScheduler scheduler
)
[ExtensionAttribute]
public:
generic<typename TSource>
static Func<TSource, IObservable<Unit>^>^ ToAsync(
    Action<TSource>^ action, 
    IScheduler^ scheduler
)
static member ToAsync : 
        action:Action<'TSource> * 
        scheduler:IScheduler -> 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