C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeRe.PollingOptions Class Reference

Determines the behaviour of the API when automatically retrying a request whose result is not yet ready for retrieval. More...

Public Member Functions

 PollingOptions (int? minPollInterval=null, int? maxPollInterval=null, int? maxPollTotalTime=null, double? backoffRate=null, CancellationToken? cancellationToken=null)
 Construct a set of Polling Arguments.
 
int GetNextPollTime (int lastTimeWaited, int totalTimeWaited)
 Compute the next amount of time we should wait before polling again, based on the previous time waited and the configured polling parameters.
 

Properties

double BackoffRate = 2.0d [get]
 The rate at which the polling interval is increased after repeated attempts. The interval will not be increased beyond MaxPollInterval. (Default is 2.0, which will double the wait time between each request.)
 
CancellationToken? CancellationToken [get]
 A cancellation token (if available) supplied to the polling method to allow the polling task to be cancelled.
 
static PollingOptions Default [get]
 The default PollingArguments used when none are specified.
 
int MaxPollInterval = 10 * 1000 [get]
 The maximum time (in milliseconds) to wait between retrying the request. (Default is a maximum of 10 seconds between retries.)
 
int MaxPollTotalTime = Int32.MaxValue [get]
 The maximum time (in milliseconds) to poll the request before raising a NotWaitingException. (Default is to poll forever.)
 
int MinPollInterval = 0 [get]
 The minimum time (in milliseconds) to wait between retrying the request. (Default is no minimum time.)
 

Detailed Description

Determines the behaviour of the API when automatically retrying a request whose result is not yet ready for retrieval.

Definition at line 8 of file PollingOptions.cs.

Inheritance diagram for AnalyzeRe.PollingOptions:
AnalyzeRe.API.PollingOptions

Constructor & Destructor Documentation

◆ PollingOptions()

AnalyzeRe.PollingOptions.PollingOptions ( int?  minPollInterval = null,
int?  maxPollInterval = null,
int?  maxPollTotalTime = null,
double?  backoffRate = null,
CancellationToken cancellationToken = null 
)
inline

Construct a set of Polling Arguments.

Parameters
minPollIntervalOptional (Default: No Minimum) The minimum time (in milliseconds) to wait between retrying the request.
maxPollIntervalOptional (Default: 10,000 (10 seconds)) The maximum time (in milliseconds) to wait between retry attempts.
maxPollTotalTimeOptional (Default: Poll Forever) The maximum time (in milliseconds) to poll the request before raising a NotWaitingException.
backoffRateThe rate at which the polling interval is increased after repeated attempts. The interval will not be increased beyond MaxPollInterval.
cancellationTokenA cancellation token (if available) supplied to the polling method to allow the polling task to be cancelled.
Exceptions
ArgumentOutOfRangeExceptionThe specified min and max polling intervals do not result in meaningful bounds.

Definition at line 49 of file PollingOptions.cs.

Member Function Documentation

◆ GetNextPollTime()

int AnalyzeRe.PollingOptions.GetNextPollTime ( int  lastTimeWaited,
int  totalTimeWaited 
)
inline

Compute the next amount of time we should wait before polling again, based on the previous time waited and the configured polling parameters.

Parameters
lastTimeWaitedThe last time waited before polling.
totalTimeWaitedThe total time waited so far in the current polling session.
Returns
The next amount of time these polling options dictate we should wait.

Definition at line 84 of file PollingOptions.cs.

Property Documentation

◆ BackoffRate

double AnalyzeRe.PollingOptions.BackoffRate = 2.0d
get

The rate at which the polling interval is increased after repeated attempts. The interval will not be increased beyond MaxPollInterval. (Default is 2.0, which will double the wait time between each request.)

Definition at line 28 of file PollingOptions.cs.

◆ CancellationToken

CancellationToken? AnalyzeRe.PollingOptions.CancellationToken
get

A cancellation token (if available) supplied to the polling method to allow the polling task to be cancelled.

Definition at line 32 of file PollingOptions.cs.

◆ Default

PollingOptions AnalyzeRe.PollingOptions.Default
staticget

The default PollingArguments used when none are specified.

Definition at line 11 of file PollingOptions.cs.

◆ MaxPollInterval

int AnalyzeRe.PollingOptions.MaxPollInterval = 10 * 1000
get

The maximum time (in milliseconds) to wait between retrying the request. (Default is a maximum of 10 seconds between retries.)

Definition at line 19 of file PollingOptions.cs.

◆ MaxPollTotalTime

int AnalyzeRe.PollingOptions.MaxPollTotalTime = Int32.MaxValue
get

The maximum time (in milliseconds) to poll the request before raising a NotWaitingException. (Default is to poll forever.)

Definition at line 23 of file PollingOptions.cs.

◆ MinPollInterval

int AnalyzeRe.PollingOptions.MinPollInterval = 0
get

The minimum time (in milliseconds) to wait between retrying the request. (Default is no minimum time.)

Definition at line 15 of file PollingOptions.cs.


The documentation for this class was generated from the following file: