Skip to content

)} })} )} })} )} })} )} })} )} })} )} })}

Scheduler.ScheduleAsync(IScheduler, TState, Func) method

Defined in

Type: Scheduler Namespace: System.Reactive.Concurrency Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, Func<IScheduler, TState, CancellationToken, Task> action)
  • 2. public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
  • 3. public static IDisposable ScheduleAsync(this IScheduler scheduler, Func<IScheduler, CancellationToken, Task> action)
  • 4. public static IDisposable ScheduleAsync(this IScheduler scheduler, Func<IScheduler, CancellationToken, Task<IDisposable>> action)
  • 5. public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, TimeSpan dueTime, Func<IScheduler, TState, CancellationToken, Task> action)
  • 6. public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, TimeSpan dueTime, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
  • 7. public static IDisposable ScheduleAsync(this IScheduler scheduler, TimeSpan dueTime, Func<IScheduler, CancellationToken, Task> action)
  • 8. public static IDisposable ScheduleAsync(this IScheduler scheduler, TimeSpan dueTime, Func<IScheduler, CancellationToken, Task<IDisposable>> action)
  • 9. public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, DateTimeOffset dueTime, Func<IScheduler, TState, CancellationToken, Task> action)
  • 10. public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, DateTimeOffset dueTime, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
  • 11. public static IDisposable ScheduleAsync(this IScheduler scheduler, DateTimeOffset dueTime, Func<IScheduler, CancellationToken, Task> action)
  • 12. public static IDisposable ScheduleAsync(this IScheduler scheduler, DateTimeOffset dueTime, Func<IScheduler, CancellationToken, Task<IDisposable>> action)

1. Overload

public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, Func<IScheduler, TState, CancellationToken, Task> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Type parameters

NameDescription
TStateThe type of the state passed to the scheduled action.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
stateTStateState to pass to the asynchronous method.
actionFuncAsynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

2. Overload

public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Type parameters

NameDescription
TStateThe type of the state passed to the scheduled action.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
stateTStateState to pass to the asynchronous method.
actionFunc>Asynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

3. Overload

public static IDisposable ScheduleAsync(this IScheduler scheduler, Func<IScheduler, CancellationToken, Task> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
actionFuncAsynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

4. Overload

public static IDisposable ScheduleAsync(this IScheduler scheduler, Func<IScheduler, CancellationToken, Task<IDisposable>> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
actionFunc>Asynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

5. Overload

public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, TimeSpan dueTime, Func<IScheduler, TState, CancellationToken, Task> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Type parameters

NameDescription
TStateThe type of the state passed to the scheduled action.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
stateTStateState to pass to the asynchronous method.
dueTimeTimeSpanRelative time after which to execute the action.
actionFuncAsynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

6. Overload

public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, TimeSpan dueTime, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Type parameters

NameDescription
TStateThe type of the state passed to the scheduled action.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
stateTStateState to pass to the asynchronous method.
dueTimeTimeSpanRelative time after which to execute the action.
actionFunc>Asynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

7. Overload

public static IDisposable ScheduleAsync(this IScheduler scheduler, TimeSpan dueTime, Func<IScheduler, CancellationToken, Task> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
dueTimeTimeSpanRelative time after which to execute the action.
actionFuncAsynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

8. Overload

public static IDisposable ScheduleAsync(this IScheduler scheduler, TimeSpan dueTime, Func<IScheduler, CancellationToken, Task<IDisposable>> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
dueTimeTimeSpanRelative time after which to execute the action.
actionFunc>Asynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

9. Overload

public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, DateTimeOffset dueTime, Func<IScheduler, TState, CancellationToken, Task> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Type parameters

NameDescription
TStateThe type of the state passed to the scheduled action.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
stateTStateState to pass to the asynchronous method.
dueTimeDateTimeOffsetAbsolute time at which to execute the action.
actionFuncAsynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

10. Overload

public static IDisposable ScheduleAsync<TState>(this IScheduler scheduler, TState state, DateTimeOffset dueTime, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Type parameters

NameDescription
TStateThe type of the state passed to the scheduled action.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
stateTStateState to pass to the asynchronous method.
dueTimeDateTimeOffsetAbsolute time at which to execute the action.
actionFunc>Asynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

11. Overload

public static IDisposable ScheduleAsync(this IScheduler scheduler, DateTimeOffset dueTime, Func<IScheduler, CancellationToken, Task> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
dueTimeDateTimeOffsetAbsolute time at which to execute the action.
actionFuncAsynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.

12. Overload

public static IDisposable ScheduleAsync(this IScheduler scheduler, DateTimeOffset dueTime, Func<IScheduler, CancellationToken, Task<IDisposable>> action)

Summary: Schedules work using an asynchronous method, allowing for cooperative scheduling in an imperative coding style.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to schedule work on.
dueTimeDateTimeOffsetAbsolute time at which to execute the action.
actionFunc>Asynchronous method to run the work, using Yield and Sleep operations for cooperative scheduling and injection of cancellation points.

Returns: IDisposable -- Disposable object that allows to cancel outstanding work on cooperative cancellation points or through the cancellation token passed to the asynchronous method.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler or action is null.