C# Класс CSharpAnalytics.Network.BackgroundHttpRequester

Responsible for requesting a queue of URIs over HTTP or HTTPS in background.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
NetworkRetryWaitMax System.TimeSpan
NetworkRetryWaitStep System.TimeSpan

Private Properties

Свойство Тип Описание
Dispose void
GetNextQueueEntry bool
RequestLoop void
ShouldUsePostForRequest bool

Открытые методы

Метод Описание
Add ( Uri uri ) : void

Add a URI to be requested to the queue.

Dispose ( ) : void
Start ( System.TimeSpan uploadInterval, IEnumerable previouslyUnrequested = null ) : void

Start the BackgroundHttpRequester with a given upload interval and a list of previously unrequested URIs.

StopAsync ( ) : Task>

Stop the BackgroundHttpRequester and return a list of URIs that were not requested.

Защищенные методы

Метод Описание
GetInnermostException ( Exception ex ) : Exception

Obtain the innermost Exception from within an Exception.

RequestWithFailureRetry ( Uri requestUri, CancellationToken cancellationToken ) : void

Request the URI retrying as appropriate if a failure occurs.

WaitBetweenFailedRequests ( System.TimeSpan &previousRetryDelay ) : void

Delay for a period of time between failed network requests.

Приватные методы

Метод Описание
Dispose ( bool isDisposing ) : void
GetNextQueueEntry ( Uri &entry ) : bool

Get the next entry from the queue.

RequestLoop ( ) : void

Loop that keeps requesting URIs in the queue until there are none left, then sleeps.

ShouldUsePostForRequest ( Uri requestUri ) : bool

Whether a URI request is too long to be sent as a GET and instead the query parameters should be sent as the body of a POST instead.

Описание методов

Add() публичный Метод

Add a URI to be requested to the queue.
public Add ( Uri uri ) : void
uri System.Uri URI to be requested.
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetInnermostException() защищенный статический Метод

Obtain the innermost Exception from within an Exception.
protected static GetInnermostException ( Exception ex ) : Exception
ex System.Exception Exception to obtain the innermost exception from.
Результат System.Exception

RequestWithFailureRetry() защищенный абстрактный Метод

Request the URI retrying as appropriate if a failure occurs.
protected abstract RequestWithFailureRetry ( Uri requestUri, CancellationToken cancellationToken ) : void
requestUri System.Uri URI to requqest.
cancellationToken System.Threading.CancellationToken
Результат void

Start() публичный Метод

Start the BackgroundHttpRequester with a given upload interval and a list of previously unrequested URIs.
public Start ( System.TimeSpan uploadInterval, IEnumerable previouslyUnrequested = null ) : void
uploadInterval System.TimeSpan How often to send the contents of the queue.
previouslyUnrequested IEnumerable List of previously unrequested URIs obtained last time the requester was stopped.
Результат void

StopAsync() публичный Метод

Stop the BackgroundHttpRequester and return a list of URIs that were not requested.
public StopAsync ( ) : Task>
Результат Task>

WaitBetweenFailedRequests() защищенный Метод

Delay for a period of time between failed network requests.
protected WaitBetweenFailedRequests ( System.TimeSpan &previousRetryDelay ) : void
previousRetryDelay System.TimeSpan Previous retry delay value to base delay on.
Результат void

Описание свойств

NetworkRetryWaitMax защищенное статическое свойство

protected static TimeSpan,System NetworkRetryWaitMax
Результат System.TimeSpan

NetworkRetryWaitStep защищенное статическое свойство

protected static TimeSpan,System NetworkRetryWaitStep
Результат System.TimeSpan