Constructor
new SyncQueue()
Methods
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
(static) all(list, stopOnError)
- Description:
Await ordered functions
Parameters:
Name | Type | Default | Description |
---|---|---|---|
list |
Array | Array of function(resolve, reject) to execute asynchronously |
|
stopOnError |
boolean |
true
|
Stop on first error (default true)? |
Returns:
Promise with ordered result array of { index, status:'fulfilled' or 'rejected', value or reason }
(static) allSettled(list)
- Description:
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 }