Scheduler
Direct Subclass:
Indirect Subclass:
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.
Each unit of work in a Scheduler is called an Action.
class Scheduler {
now(): number;
schedule(work, delay?, state?): Subscription;
}
Method Summary
Public Methods | ||
public |
schedule(work: function(state: ?T): ?Subscription, delay: number, state: T): Subscription Schedules a function, |
Public Methods
public schedule(work: function(state: ?T): ?Subscription, delay: number, state: T): Subscription source
Schedules a function, work
, for execution. May happen at some point in
the future, according to the delay
parameter, if specified. May be passed
some context object, state
, which will be passed to the work
function.
The given arguments will be processed an stored as an Action object in a queue of actions.
Params:
Name | Type | Attribute | Description |
work | function(state: ?T): ?Subscription | A function representing a task, or some unit of work to be executed by the Scheduler. |
|
delay | number |
|
Time to wait before executing the work, where the time unit is implicit and defined by the Scheduler itself. |
state | T |
|
Some contextual data that the |