exponentialRetryPolicy.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { HttpOperationResponse } from "../httpOperationResponse";
  2. import { WebResource } from "../webResource";
  3. import { BaseRequestPolicy, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "./requestPolicy";
  4. export interface RetryData {
  5. retryCount: number;
  6. retryInterval: number;
  7. error?: RetryError;
  8. }
  9. export interface RetryError extends Error {
  10. message: string;
  11. code?: string;
  12. innerError?: RetryError;
  13. }
  14. export declare function exponentialRetryPolicy(retryCount?: number, retryInterval?: number, minRetryInterval?: number, maxRetryInterval?: number): RequestPolicyFactory;
  15. /**
  16. * @class
  17. * Instantiates a new "ExponentialRetryPolicyFilter" instance.
  18. */
  19. export declare class ExponentialRetryPolicy extends BaseRequestPolicy {
  20. /**
  21. * The client retry count.
  22. */
  23. retryCount: number;
  24. /**
  25. * The client retry interval in milliseconds.
  26. */
  27. retryInterval: number;
  28. /**
  29. * The minimum retry interval in milliseconds.
  30. */
  31. minRetryInterval: number;
  32. /**
  33. * The maximum retry interval in milliseconds.
  34. */
  35. maxRetryInterval: number;
  36. /**
  37. * @constructor
  38. * @param {RequestPolicy} nextPolicy The next RequestPolicy in the pipeline chain.
  39. * @param {RequestPolicyOptions} options The options for this RequestPolicy.
  40. * @param {number} [retryCount] The client retry count.
  41. * @param {number} [retryInterval] The client retry interval, in milliseconds.
  42. * @param {number} [minRetryInterval] The minimum retry interval, in milliseconds.
  43. * @param {number} [maxRetryInterval] The maximum retry interval, in milliseconds.
  44. */
  45. constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, retryCount?: number, retryInterval?: number, minRetryInterval?: number, maxRetryInterval?: number);
  46. sendRequest(request: WebResource): Promise<HttpOperationResponse>;
  47. }
  48. //# sourceMappingURL=exponentialRetryPolicy.d.ts.map