public class BackOffHandler.Initializer
An initializer class to initialize a back-off handler.
Namespace
GoogleApisHttpAssembly
Google.Apis.Core.dll
Constructors
Initializer(IBackOff)
public Initializer(IBackOff backOff)
Constructs a new initializer by the given back-off.
Parameter | |
---|---|
Name | Description |
backOff |
IBackOff |
Fields
DefaultHandleExceptionFunc
public static readonly Func<Exception, bool> 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.
Field Value | |
---|---|
Type | Description |
FuncExceptionbool |
DefaultHandleUnsuccessfulResponseFunc
public static readonly Func<HttpResponseMessage, bool> DefaultHandleUnsuccessfulResponseFunc
Default function which handles server errors (503).
Field Value | |
---|---|
Type | Description |
FuncHttpResponseMessagebool |
Properties
BackOff
public IBackOff BackOff { get; }
Gets the back-off policy used by this back-off handler.
Property Value | |
---|---|
Type | Description |
IBackOff |
HandleExceptionFunc
public 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.
Property Value | |
---|---|
Type | Description |
FuncExceptionbool |
HandleUnsuccessfulResponseFunc
public 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.
Property Value | |
---|---|
Type | Description |
FuncHttpResponseMessagebool |
MaxTimeSpan
public 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.
Property Value | |
---|---|
Type | Description |
TimeSpan |