Show / Hide Table of Contents

Class BackOffHandler.Initializer

An initializer class to initialize a back-off handler.

Inheritance
object
BackOffHandler.Initializer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Http
Assembly: Google.Apis.Core.dll
Syntax
public class BackOffHandler.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 TaskCanceledException or 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
Func<Exception, bool>

DefaultHandleUnsuccessfulResponseFunc

Default function which handles server errors (503).

Declaration
public static readonly Func<HttpResponseMessage, bool> DefaultHandleUnsuccessfulResponseFunc
Field Value
Type Description
Func<HttpResponseMessage, bool>

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
Func<Exception, bool>

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
Func<HttpResponseMessage, bool>

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
TimeSpan

Extension Methods

Utilities.ThrowIfNull<T>(T, string)
In this article
Back to top Generated by DocFX