id | title | hide_title |
---|---|---|
faastjs.limits |
Limits interface |
true |
Specify throttle() limits. These limits shape the way throttle invokes the underlying function.
Signature:
export interface Limits
Property |
Modifiers |
Type |
Description |
---|---|---|---|
number |
(Optional) The maximum number of calls to the underlying function to "burst" -- e.g. the number that can be issued immediately as long as the rate limit is not exceeded. For example, if rate is 5 and burst is 5, and 10 calls are made to the throttled function, 5 calls are made immediately and then after 1 second, another 5 calls are made immediately. Setting burst to 1 means calls are issued uniformly every | ||
(Optional) Similar to | |||
number |
The maximum number of concurrent executions of the underlying function to allow. Must be supplied, there is no default. Specifying | ||
boolean |
(Optional) If The arguments will be captured with | ||
number |
(Optional) The maximum number of calls per second to allow to the underlying function. Default: no rate limit. | ||
number | ((err: any, retries: number) => boolean) |
(Optional) Retry if the throttled function returns a rejected promise. |