Table of Contents

Class TaskPoolScheduler

Namespace
RxSharp
Assembly
RxSharp.dll

The default IScheduler, backed by Task.Delay(TimeSpan, CancellationToken).

public sealed class TaskPoolScheduler : IScheduler
Inheritance
System.Object
TaskPoolScheduler
Implements

Fields

Instance

Gets the shared, stateless singleton instance of this scheduler.

public static readonly TaskPoolScheduler Instance

Field Value

TaskPoolScheduler

Properties

Now

Gets the scheduler's current notion of "now". Used by time-based operators instead of reading the system clock directly, so a future virtual-time scheduler can control it.

public DateTimeOffset Now { get; }

Property Value

DateTimeOffset

Methods

Schedule(Action, TimeSpan)

Schedules action via Task.Delay(TimeSpan, CancellationToken) on the default task scheduler. Disposing the returned subscription before dueTime elapses cancels the delay so action never runs.

public IDisposable Schedule(Action action, TimeSpan dueTime)

Parameters

action Action

The work to run.

dueTime TimeSpan

How long to wait before running action. A negative value is treated as zero.

Returns

IDisposable

A disposable that cancels the scheduled work if disposed before it runs.