Execute a promise with timeout settings from a TimeoutConfig.
Convenience wrapper around withTimeout for callers that already hold a TimeoutConfig object (e.g., from environment config).
TimeoutConfig
Type of the promise result
Promise to execute with timeout
Timeout configuration object
Promise resolving with the result or rejecting with TimeoutError
If the operation exceeds config.timeoutMs
config.timeoutMs
If config.timeoutMs is not positive
const config: TimeoutConfig = { timeoutMs: 5000, operationName: 'fetchMEPs' };const result = await withTimeoutConfig(fetchMEPs(), config); Copy
const config: TimeoutConfig = { timeoutMs: 5000, operationName: 'fetchMEPs' };const result = await withTimeoutConfig(fetchMEPs(), config);
0.8.0
Execute a promise with timeout settings from a TimeoutConfig.
Convenience wrapper around withTimeout for callers that already hold a
TimeoutConfigobject (e.g., from environment config).