Skip to content

})} )}

SchedulerExtensions.WithAsync(T, Func>) method

Defined in

Type: SchedulerExtensions Namespace: ReactiveUI.Testing Assembly: ReactiveUI.Testing.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net471

Overloads

  • 1. public static Task<TRet> WithAsync<T, TRet>(this T scheduler, Func<T, Task<TRet>> block) where T : IScheduler
  • 2. public static Task WithAsync<T>(this T scheduler, Func<T, Task> block) where T : IScheduler

1. Overload

public static Task<TRet> WithAsync<T, TRet>(this T scheduler, Func<T, Task<TRet>> block) where T : IScheduler

Summary: With is an extension method that uses the given scheduler as the default Deferred and Taskpool schedulers for the given Func. Use this to initialize objects that store the default scheduler (most RxXaml objects).

Type parameters

NameDescription
TThe type.
TRetThe return type.

Parameters

NameTypeDescription
schedulerTThe scheduler to use.
blockFunc>The function to execute.

Returns: Task -- The return value of the function.

2. Overload

public static Task WithAsync<T>(this T scheduler, Func<T, Task> block) where T : IScheduler

View source

Summary: With is an extension method that uses the given scheduler as the default Deferred and Taskpool schedulers for the given Action.

Type parameters

NameDescription
TThe type.

Parameters

NameTypeDescription
schedulerTThe scheduler to use.
blockFuncThe action to execute.

Returns: Task -- A Task representing the asynchronous operation.