ts-lambda-api - v2.5.2
    Preparing search index...

    Interface RetryStrategyV2

    interface RetryStrategyV2 {
        acquireInitialRetryToken(retryTokenScope: string): Promise<RetryToken>;
        recordSuccess(token: RetryToken): void;
        refreshRetryTokenForRetry(
            tokenToRenew: RetryToken,
            errorInfo: RetryErrorInfo,
        ): Promise<RetryToken>;
    }
    Index

    Methods

    • Called before any retries (for the first call to the operation). It either returns a retry token or an error upon the failure to acquire a token prior.

      tokenScope is arbitrary and out of scope for this component. However, adding it here offers us a lot of future flexibility for outage detection. For example, it could be "us-east-1" on a shared retry strategy, or "us-west-2-c:dynamodb".

      Parameters

      • retryTokenScope: string

      Returns Promise<RetryToken>

    • Upon successful completion of the operation, this function is called to record that the operation was successful.

      Parameters

      Returns void

    • After a failed operation call, this function is invoked to refresh the retryToken returned by acquireInitialRetryToken(). This function can either choose to allow another retry and send a new or updated token, or reject the retry attempt and report the error either in an exception or returning an error.

      Parameters

      Returns Promise<RetryToken>