50 int? minPollInterval =
null,
51 int? maxPollInterval =
null,
52 int? maxPollTotalTime =
null,
53 double? backoffRate =
null,
56 if (minPollInterval.HasValue)
58 if (maxPollInterval.HasValue)
60 if (maxPollTotalTime.HasValue)
62 if (backoffRate.HasValue)
65 throw new ArgumentOutOfRangeException(nameof(minPollInterval),
66 "Value must be greater than or equal to zero.");
68 throw new ArgumentOutOfRangeException(nameof(backoffRate),
69 "Value must be greater than or equal to 1.");
71 throw new ArgumentOutOfRangeException(nameof(minPollInterval),
72 "Value must be less than or equal to " + nameof(maxPollInterval) +
".");
74 throw new ArgumentOutOfRangeException(nameof(maxPollTotalTime),
75 "Value must be greater than or equal to zero.");
86 int nextTime = lastTimeWaited == 0 ? 1 : lastTimeWaited;
88 nextTime = (int)Math.Ceiling(nextTime *
BackoffRate);
99 public static partial class API
102 [Obsolete(
"This class has moved to the AnalyzeRe namespace. " +
103 "You should remove the `API` prefix.")]
112 [Obsolete(
"This class has moved to the AnalyzeRe namespace. " +
113 "You should remove the `API` prefix.")]
115 int? minPollInterval =
null,
116 int? maxPollInterval =
null,
117 int? maxPollTotalTime =
null,
118 double? backoffRate =
null,
120 : base(minPollInterval, maxPollInterval, maxPollTotalTime,
121 backoffRate, cancellationToken)
A duplicate of the AnalyzeRe.PollingOptions class.
PollingOptions(int? minPollInterval=null, int? maxPollInterval=null, int? maxPollTotalTime=null, double? backoffRate=null, CancellationToken? cancellationToken=null)
AnalyzeRe.PollingOptions
Determines the behaviour of the API when automatically retrying a request whose result is not yet rea...
PollingOptions(int? minPollInterval=null, int? maxPollInterval=null, int? maxPollTotalTime=null, double? backoffRate=null, CancellationToken? cancellationToken=null)
Construct a set of Polling Arguments.
CancellationToken? CancellationToken
A cancellation token (if available) supplied to the polling method to allow the polling task to be ca...
int MaxPollTotalTime
The maximum time (in milliseconds) to poll the request before raising a NotWaitingException....
int MaxPollInterval
The maximum time (in milliseconds) to wait between retrying the request. (Default is a maximum of 10 ...
int MinPollInterval
The minimum time (in milliseconds) to wait between retrying the request. (Default is no minimum time....
int GetNextPollTime(int lastTimeWaited, int totalTimeWaited)
Compute the next amount of time we should wait before polling again, based on the previous time waite...
double BackoffRate
The rate at which the polling interval is increased after repeated attempts. The interval will not be...
static PollingOptions Default
The default PollingArguments used when none are specified.