DefaultReconnectPolicy.js 654 B

1234567891011121314
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // 0, 2, 10, 30 second delays before reconnect attempts.
  4. const DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];
  5. /** @private */
  6. export class DefaultReconnectPolicy {
  7. constructor(retryDelays) {
  8. this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;
  9. }
  10. nextRetryDelayInMilliseconds(retryContext) {
  11. return this._retryDelays[retryContext.previousRetryCount];
  12. }
  13. }
  14. //# sourceMappingURL=DefaultReconnectPolicy.js.map