Google API Client Library for .NET  1.10.0
Public Member Functions | Static Public Attributes | Properties | List of all members
Google.Apis.Http.BackOffHandler.Initializer Class Reference

An initializer class to initialize a back-off handler. More...

Public Member Functions

 Initializer (IBackOff backOff)
 Constructs a new initializer by the given back-off. More...
 

Static Public Attributes

static readonly Func
< HttpResponseMessage, bool > 
DefaultHandleUnsuccessfulResponseFunc
 Default function which handles server errors (503). More...
 
static readonly Func
< Exception, bool > 
DefaultHandleExceptionFunc
 Default function which handles exception which aren't System.Threading.Tasks.TaskCanceledException or System.OperationCanceledException. Those exceptions represent a task or an operation which was canceled and shouldn't be retried. More...
 

Properties

IBackOff BackOff [get, set]
 Gets the back-off policy used by this back-off handler. More...
 
TimeSpan MaxTimeSpan [get, set]
 Gets or sets the maximum time span to wait. If the back-off instance returns a greater time span than this value, this handler returns false to both HandleExceptionAsync and HandleResponseAsync. Default value is 16 seconds per a retry request. More...
 
Func< HttpResponseMessage, bool > HandleUnsuccessfulResponseFunc [get, set]
 Gets or sets a delegate function which indicates whether this back-off handler should handle an abnormal HTTP response. The default is DefaultHandleUnsuccessfulResponseFunc. More...
 
Func< Exception, bool > HandleExceptionFunc [get, set]
 Gets or sets a delegate function which indicates whether this back-off handler should handle an exception. The default is DefaultHandleExceptionFunc. More...
 

Detailed Description

An initializer class to initialize a back-off handler.

Constructor & Destructor Documentation

Google.Apis.Http.BackOffHandler.Initializer.Initializer ( IBackOff  backOff)
inline

Constructs a new initializer by the given back-off.

Member Data Documentation

readonly Func<Exception, bool> Google.Apis.Http.BackOffHandler.Initializer.DefaultHandleExceptionFunc
static
Initial value:
=
(ex) => !(ex is TaskCanceledException || ex is OperationCanceledException)

Default function which handles exception which aren't System.Threading.Tasks.TaskCanceledException or System.OperationCanceledException. Those exceptions represent a task or an operation which was canceled and shouldn't be retried.

readonly Func<HttpResponseMessage, bool> Google.Apis.Http.BackOffHandler.Initializer.DefaultHandleUnsuccessfulResponseFunc
static
Initial value:
=
(r) => (int)r.StatusCode == 503

Default function which handles server errors (503).

Property Documentation

IBackOff Google.Apis.Http.BackOffHandler.Initializer.BackOff
getset

Gets the back-off policy used by this back-off handler.

Func<Exception, bool> Google.Apis.Http.BackOffHandler.Initializer.HandleExceptionFunc
getset

Gets or sets a delegate function which indicates whether this back-off handler should handle an exception. The default is DefaultHandleExceptionFunc.

Func<HttpResponseMessage, bool> Google.Apis.Http.BackOffHandler.Initializer.HandleUnsuccessfulResponseFunc
getset

Gets or sets a delegate function which indicates whether this back-off handler should handle an abnormal HTTP response. The default is DefaultHandleUnsuccessfulResponseFunc.

TimeSpan Google.Apis.Http.BackOffHandler.Initializer.MaxTimeSpan
getset

Gets or sets the maximum time span to wait. If the back-off instance returns a greater time span than this value, this handler returns false to both HandleExceptionAsync and HandleResponseAsync. Default value is 16 seconds per a retry request.


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