Metzploreur/node_modules/@smithy/util-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts
clement callaert 244d45ceb8 Version 2
2023-11-01 17:33:25 +01:00

26 lines
1,017 B
TypeScript

import { Provider, RetryErrorInfo, RetryStrategyV2, StandardRetryToken } from "@smithy/types";
/**
* @public
*/
export declare class StandardRetryStrategy implements RetryStrategyV2 {
private readonly maxAttempts;
readonly mode: string;
private capacity;
private readonly retryBackoffStrategy;
private readonly maxAttemptsProvider;
constructor(maxAttempts: number);
constructor(maxAttemptsProvider: Provider<number>);
acquireInitialRetryToken(retryTokenScope: string): Promise<StandardRetryToken>;
refreshRetryTokenForRetry(token: StandardRetryToken, errorInfo: RetryErrorInfo): Promise<StandardRetryToken>;
recordSuccess(token: StandardRetryToken): void;
/**
* @returns the current available retry capacity.
*
* This number decreases when retries are executed and refills when requests or retries succeed.
*/
getCapacity(): number;
private getMaxAttempts;
private shouldRetry;
private getCapacityCost;
private isRetryableError;
}