Returns true if queue is empty
Number of items in queue
Adds event listener.
Events
Event name
Event handler
Clears all tasks, and stops any scheduled processing. Currently running tasks will continue.
Adds a task. This triggers processing loop if not already started.
queue.add(async () => {
await sleep(1000);
});
Task to run
Protected
fireFire event
Type of event
Arguments for event
Remove event listener
Simple task queue. Each task is awaited and run in turn.
The TaskQueueMutable is shared across your code, so you don't create it directly. Rather, use:
Example: Usage
You can listen to events from the TaskQueue: