Version: 0.0.03.0.0-preview7.19365.73.0.0-preview8.19405.73.0.0-preview9.19424.43.0.0-rc1.19457.43.0.03.0.13.0.33.1.0-preview1.19508.203.1.0-preview2.19528.83.1.0-preview3.19555.23.1.03.1.23.1.33.1.43.1.53.1.63.1.73.1.83.1.93.1.103.1.113.1.123.1.133.1.143.1.153.1.163.1.173.1.183.1.193.1.203.1.213.1.223.1.233.1.243.1.253.1.263.1.273.1.283.1.293.1.303.1.315.0.0-preview.1.20124.55.0.0-preview.2.20167.35.0.0-preview.3.20215.145.0.0-preview.4.20257.105.0.0-preview.5.20279.25.0.0-preview.6.20312.155.0.0-preview.7.20365.195.0.0-preview.8.20414.85.0.0-rc.1.20451.175.0.0-rc.2.20475.175.0.05.0.15.0.25.0.35.0.45.0.55.0.65.0.75.0.85.0.95.0.105.0.115.0.125.0.135.0.145.0.155.0.165.0.176.0.0-preview.1.21103.66.0.0-preview.2.21154.66.0.0-preview.3.21201.136.0.0-preview.4.21253.56.0.0-preview.5.21301.176.0.0-preview.6.21355.26.0.0-preview.7.21378.66.0.0-rc.1.21452.156.0.0-rc.2.21480.106.0.06.0.16.0.26.0.36.0.46.0.56.0.66.0.76.0.86.0.96.0.106.0.116.0.136.0.146.0.156.0.166.0.186.0.206.0.216.0.226.0.236.0.257.0.0-preview.1.22109.137.0.0-preview.2.22153.27.0.0-preview.3.22178.47.0.0-preview.4.22251.17.0.0-preview.5.22303.87.0.0-preview.6.22330.37.0.0-preview.7.22376.67.0.0-rc.1.22427.27.0.0-rc.2.22476.27.0.07.0.27.0.37.0.47.0.57.0.77.0.97.0.107.0.117.0.127.0.148.0.0-preview.1.23112.28.0.0-preview.2.23153.28.0.0-preview.3.23177.88.0.0-preview.4.23260.48.0.0-preview.5.23302.28.0.0-preview.6.23329.118.0.0-preview.7.23375.98.0.0-rc.1.23421.298.0.0-rc.2.23480.28.0.08.0.7
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
/** An abstraction that controls when the client attempts to reconnect and how many times it does so. */
export interface IRetryPolicy {
/** Called after the transport loses the connection.
*
* @param {RetryContext} retryContext Details related to the retry event to help determine how long to wait for the next retry.
* @returns {number | null} The amount of time in milliseconds to wait before the next retry. `null` tells the client to stop retrying.
*/
nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null;
}
export interface RetryContext {
/**
* The number of consecutive failed tries so far.
readonly previousRetryCount: number;
* The amount of time in milliseconds spent retrying so far.
readonly elapsedMilliseconds: number;
* The error that forced the upcoming retry.
readonly retryReason: Error;