A library to throttle promises
Name | Type | Description | |
---|---|---|---|
options |
Object
|
A set op options to pass to the throttle function |
|
requestsPerSecond |
number
|
The amount of requests per second the library will limit to |
Void
Adds a promise
Name | Type | Description | |
---|---|---|---|
promise |
Function
|
A function returning the promise to be added |
|
options |
Object
|
A set of options. |
|
options.signal |
number
|
An AbortSignal object that can be used to abort the returned promise |
|
options.weight |
number
|
A "weight" of each operation resolving by array of promises |
Promise
A promise
Adds all the promises passed as parameters
Name | Type | Description | |
---|---|---|---|
promises |
Function
|
An array of functions that return a promise |
|
options |
Object
|
A set of options. |
|
options.signal |
number
|
An AbortSignal object that can be used to abort the returned promise |
|
options.weight |
number
|
A "weight" of each operation resolving by array of promises |
Promise
A promise that succeeds when all the promises passed as options do
Name | Type | Description | |
---|---|---|---|
options |
Object
|
A set op options to pass to the throttle function |
|
requestsPerSecond |
number
|
The amount of requests per second the library will limit to |
Void
Adds a promise
Name | Type | Description | |
---|---|---|---|
promise |
Function
|
A function returning the promise to be added |
|
options |
Object
|
A set of options. |
|
options.signal |
number
|
An AbortSignal object that can be used to abort the returned promise |
|
options.weight |
number
|
A "weight" of each operation resolving by array of promises |
Promise
A promise
Adds all the promises passed as parameters
Name | Type | Description | |
---|---|---|---|
promises |
Function
|
An array of functions that return a promise |
|
options |
Object
|
A set of options. |
|
options.signal |
number
|
An AbortSignal object that can be used to abort the returned promise |
|
options.weight |
number
|
A "weight" of each operation resolving by array of promises |
Promise
A promise that succeeds when all the promises passed as options do