Show / Hide Table of Contents

Class BackOffHandler.Initializer

An initializer class to initialize a back-off handler.

Inheritance
System.Object
BackOffHandler.Initializer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.Http
Assembly: Google.Apis.Core.dll
Syntax
public class Initializer

Constructors

Initializer(IBackOff)

Constructs a new initializer by the given back-off.

Declaration
public Initializer(IBackOff backOff)
Parameters
Type Name Description
IBackOff backOff

Fields

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.

Declaration
public static readonly Func<Exception, bool> DefaultHandleExceptionFunc
Field Value
Type Description
System.Func<System.Exception, System.Boolean>

DefaultHandleUnsuccessfulResponseFunc

Default function which handles server errors (503).

Declaration
public static readonly Func<HttpResponseMessage, bool> DefaultHandleUnsuccessfulResponseFunc
Field Value
Type Description
System.Func<System.Net.Http.HttpResponseMessage, System.Boolean>

Properties

BackOff

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

Declaration
public IBackOff BackOff { get; }
Property Value
Type Description
IBackOff

HandleExceptionFunc

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

Declaration
public Func<Exception, bool> HandleExceptionFunc { get; set; }
Property Value
Type Description
System.Func<System.Exception, System.Boolean>

HandleUnsuccessfulResponseFunc

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

Declaration
public Func<HttpResponseMessage, bool> HandleUnsuccessfulResponseFunc { get; set; }
Property Value
Type Description
System.Func<System.Net.Http.HttpResponseMessage, System.Boolean>

MaxTimeSpan

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.

Declaration
public TimeSpan MaxTimeSpan { get; set; }
Property Value
Type Description
System.TimeSpan

Extension Methods

Utilities.ThrowIfNull<T>(T, String)
In This Article
Back to top