Scheduler
An execution context and a data structure to order tasks and schedule their
execution. Provides a notion of (potentially virtual) time, through the
now()
getter method.
Deprecation Notes
Scheduler is an internal implementation detail of RxJS, and
should not be used directly. Rather, create your own class and implement
SchedulerLike
class Scheduler implements SchedulerLike {
static now: () => number
constructor(SchedulerAction: typeof Action, now: () => number = Scheduler.now)
now: () => number
schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number = 0, state?: T): Subscription
}
Description
Each unit of work in a Scheduler is called an Action
.
class Scheduler {
now(): number;
schedule(work, delay?, state?): Subscription;
}
Static Properties
Property | Type | Description |
---|---|---|
now |
Note: the extra arrow function wrapper is to make testing by overriding Date.now easier. |
Constructor
Parameters
|
Properties
Property | Type | Description |
---|---|---|
now |
A getter method that returns a number representing the current time (at the time this function was called) according to the scheduler's own internal clock. |