Creates a new instance of Scheduler. See SchedulerOptions for default values.
Used internally for signalling state changes in the scheduler across asynchronous contexts.
Keeps an opaque reference to each Task that has been scheduled for execution.
Validates and configures the maximum amount of concurrent pending tasks. Automatically signals the scheduler's event loop to immediately process more tasks if the concurrency is increased. If the scheduler is running at capacity and the concurrency is decreased, the concurrency limit is temporarily violated until the required amount of existing pending tasks have completed.
Validates and configures the normal priority level used for the convenience method scheduleNormal.
Validates and configures the number of priorities this scheduler uses. Automatically resizes the queues based on the new value.
Validates and configures the period of time for rate limiting. Automatically signals all currently pending tasks to recalculate remaining period of time based on the new value.
The event loop of the scheduler signals queued tasks in prioritized order whenever the configured concurrency and rate allow another Task to execute.
Encapsulates a function execution in
a Promise<T> that follows its completion.
Returns a promise that resolves when a Task scheduled at a given priority would be executed next, if no other tasks with higher priorities are scheduled in the same tick. The lowest priority is used by default, if none is provided.
Returns a promise that resolves when the scheduled Task is executed. If the function throws an error, the promise will reject. If the function is asynchronous, the returned promise follows its completion.
Generated using TypeDoc
Main export of typed-scheduler. Performs asynchronous task scheduling with options for priority levels, concurrency-limiting, and rate-limiting.