C# Класс Google.Apis.Http.BackOffHandler

A thread-safe back-off handler which handles an abnormal HTTP response or an exception with Google.Apis.Util.IBackOff.
Наследование: IHttpUnsuccessfulResponseHandler, IHttpExceptionHandler
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
BackOffHandler ( IBackOff backOff ) : System

Constructs a new back-off handler with the given back-off.

BackOffHandler ( Initializer initializer ) : System

Constructs a new back-off handler with the given initializer.

HandleExceptionAsync ( Google.Apis.Http.HandleExceptionArgs args ) : Task
HandleResponseAsync ( Google.Apis.Http.HandleUnsuccessfulResponseArgs args ) : Task

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

Метод Описание
Wait ( System.TimeSpan ts, CancellationToken cancellationToken ) : Task

Waits the given time span. Overriding this method is recommended for mocking purposes.

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

Метод Описание
HandleAsync ( bool supportsRetry, int currentFailedTry, CancellationToken cancellationToken ) : Task

Handles back-off. In case the request doesn't support retry or the back-off time span is greater than the maximum time span allowed for a request, the handler returns false. Otherwise the current thread will block for x milliseconds (x is defined by the BackOff instance), and this handler returns true.

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

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

Constructs a new back-off handler with the given back-off.
public BackOffHandler ( IBackOff backOff ) : System
backOff IBackOff The back-off policy.
Результат System

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

Constructs a new back-off handler with the given initializer.
public BackOffHandler ( Initializer initializer ) : System
initializer Initializer
Результат System

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

public HandleExceptionAsync ( Google.Apis.Http.HandleExceptionArgs args ) : Task
args Google.Apis.Http.HandleExceptionArgs
Результат Task

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

public HandleResponseAsync ( Google.Apis.Http.HandleUnsuccessfulResponseArgs args ) : Task
args Google.Apis.Http.HandleUnsuccessfulResponseArgs
Результат Task

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

Waits the given time span. Overriding this method is recommended for mocking purposes.
protected Wait ( System.TimeSpan ts, CancellationToken cancellationToken ) : Task
ts System.TimeSpan TimeSpan to wait (and block the current thread).
cancellationToken System.Threading.CancellationToken The cancellation token in case the user wants to cancel the operation in /// the middle.
Результат Task