Classes: KeyedTaskQueue

KeyedTaskQueue

Util class that maintains queues for asynchronous tasks for each key assigned to a task.


new KeyedTaskQueue()

Source:

Methods


queue(generator, key)

Queues a new task

Parameters:
Name Type Description
generator function

A function that returns a Promise (the task to be executed)

key string

The key that this task should queue under. If more tasks with the same key are already running (or queued), this task will execute after they resolve

Source:
Returns:

A promise that resolves with the result of the generator function

Type
Promise