public sealed class RetryPredicate
Reference documentation and code samples for the Google Cloud Storage v1 API class RetryPredicate.
Specifies the conditions under which a failed operation is retried. This class is immutable.
Namespace
Google.Cloud.Storage.V1Assembly
Google.Cloud.Storage.V1.dll
Properties
Never
public static RetryPredicate Never { get; }
Returns a Retry Predicate which will ensure that the operation will never retry in case of failure.
Property Value | |
---|---|
Type | Description |
RetryPredicate |
RetriableIdempotentErrors
public static RetryPredicate RetriableIdempotentErrors { get; }
Default retriable error codes for which the operation would retry unless otherwise specified by the user.
Property Value | |
---|---|
Type | Description |
RetryPredicate |
Methods
FromErrorCodePredicate(Func<int, bool>)
public static RetryPredicate FromErrorCodePredicate(Func<int, bool> predicate)
Returns a predicate which will retry based on the result of the specified delegate, which is provided with the HTTP error code for the response.
Parameter | |
---|---|
Name | Description |
predicate | Funcintbool Predicate used to determine whether or not to retry. May be null, in which case Never will be returned. |
Returns | |
---|---|
Type | Description |
RetryPredicate | Returns the retry predicate with the conditions specified for retrying. |
FromErrorCodes(params int[])
public static RetryPredicate FromErrorCodes(params int[] errorCodes)
Returns a predicate which will retry on the specified HTTP error codes. Note that only these error codes will be retried; the default error codes are not used by the returned predicate.
Parameter | |
---|---|
Name | Description |
errorCodes | int Error codes on which to retry. |
Returns | |
---|---|
Type | Description |
RetryPredicate | Returns a predicate which retries on the specified error codes. |