Skip to content

Function: createScheduler()

createScheduler(): Scheduler

Defined in: abstractions/scheduler.ts:26

Creates a cooperative asynchronous scheduler that serializes operations in a global queue.

This scheduler ensures that tasks scheduled via enqueue are executed in the order they were added, one at a time. If a task throws an error, it is rethrown asynchronously to avoid blocking subsequent tasks in the queue.

Returns

Scheduler

An object with methods to enqueue tasks and flush the queue.

Released under the MIT License.