Class KubernetesRetryHandler
A DelegatingHandler optionally used to retry transient errors encountered by Neon.Kubernetes clients.
Namespace: Neon.Kube.K8s
Assembly: Neon.Kube.dll
Syntax
public class KubernetesRetryHandler : DelegatingHandler
Constructors
KubernetesRetryHandler(IRetryPolicy)
Constructor.
Declaration
public KubernetesRetryHandler(IRetryPolicy retryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
IRetryPolicy | retryPolicy | Optionally specifies a retry policy that overrides DefaultRetryPolicy. |
KubernetesRetryHandler(HttpMessageHandler, IRetryPolicy)
Constructor.
Declaration
public KubernetesRetryHandler(HttpMessageHandler innerHandler, IRetryPolicy retryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
HttpMessageHandler | innerHandler | Specifies an overriding HTTP handler. |
IRetryPolicy | retryPolicy | Optionally specifies a retry policy that overrides DefaultRetryPolicy. |
Fields
AggressiveRetryPolicy
Returns a more aggressive KubernetesRetryHandler retry policy. This policy will retry operations for up to 15 seconds.
Declaration
public static IRetryPolicy AggressiveRetryPolicy
Field Value
Type | Description |
---|---|
IRetryPolicy |
DefaultRetryPolicy
Returns the default KubernetesRetryHandler's retry policy. This policy is relatively conservative and will retry operations for up to 120 seconds. For situations where you need to see errors before that, use AggressiveRetryPolicy or construct your own retry policy using DefaultTransientDetector(Exception) (if you wish) use that when constructing a KubernetesRetryHandler.
Declaration
public static IRetryPolicy DefaultRetryPolicy
Field Value
Type | Description |
---|---|
IRetryPolicy |
Methods
DefaultTransientDetector(Exception)
Implements default transient error detection.
Declaration
public static bool DefaultTransientDetector(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Specifies the exception being tested. |
Returns
Type | Description |
---|---|
bool |
|
SendAsync(HttpRequestMessage, CancellationToken)
Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
Declaration
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | request | The HTTP request message to send to the server. |
CancellationToken | cancellationToken | A cancellation token to cancel operation. |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | The task object representing the asynchronous operation. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |