Home > @uniformdev/canvas > createLimitPolicy

createLimitPolicy() function

Creates a request limit policy that can be passed to Uniform API clients to limit concurrent requests and handle retries and rate limits

Limiting vs Throttling: - Throttling controls how quickly new promises can be started. This is generally what we want for API rate limiting, but it does not care how many promises total are in flight. - Limiting controls how many promises can be in flight at once. This is important when retries are involved because retries are not subject to throttling, and this can result in heavy promise loads.

Signature:

Parameters

ParameterTypeDescription
{ throttle, retry, limit, }{ throttle?: Options | false; retry?: Options$1 | false; limit?: number | false; }

Returns:

LimitPolicy

A function that can be passed to Uniform API clients to limit concurrent requests and handle retries and rate limits