Constructor
new SyncQueue()
Methods
all(list, stopOnError)
- Description:
Await ordered functions
Parameters:
Name | Type | Default | Description |
---|---|---|---|
list |
Array | Array of function(resolve, reject) to execute asynchronously within Promises |
|
stopOnError |
boolean |
true
|
Stop on first error (default true)? |
Returns:
Promise with ordered result array of { index, status:'fulfilled' or 'rejected', value or reason }
allSettled(list)
- Description:
Await ordered functions
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | Array of function(resolve, reject) to execute asynchronously within Promises |
Returns:
Promise with result array of { index, status:'fulfilled' or 'rejected', value or reason }
dequeue()
- Description:
Dequeue while not empty
enqueue(promise)
- Description:
Enqueue a Promise and starts dequeue
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise |
Returns:
Promise
stop()
- Description:
Ask to stop next queued jobs