public class Initializer : objectAn initializer class to initialize a back-off handler.
Namespace
Google.Apis.HttpAssembly
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> DefaultHandleExceptionFuncDefault function which handles exception which aren't or . Those exceptions represent a task or an operation which was canceled and shouldn't be retried.
| Field Value | |
|---|---|
| Type | Description |
Func<Exception, Boolean> |
|
DefaultHandleUnsuccessfulResponseFunc
public static readonly Func<HttpResponseMessage, bool> DefaultHandleUnsuccessfulResponseFuncDefault function which handles server errors (503).
| Field Value | |
|---|---|
| Type | Description |
Func<HttpResponseMessage, Boolean> |
|
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 |
Func<Exception, Boolean> |
|
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 |
Func<HttpResponseMessage, Boolean> |
|
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 |
|