共用方式為


ClientRetryPolicy Class

Definition

A PipelinePolicy used by a ClientPipeline to decide whether or not to retry a PipelineRequest.

public class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy
type ClientRetryPolicy = class
    inherit PipelinePolicy
Public Class ClientRetryPolicy
Inherits PipelinePolicy
Inheritance
ClientRetryPolicy

Constructors

ClientRetryPolicy(Int32)

Creates a new instance of the ClientRetryPolicy class.

Properties

Default

The ClientRetryPolicy instance used by a default ClientPipeline.

Methods

GetNextDelay(PipelineMessage, Int32)

A method that can be overridden by derived types to customize the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) to determine how long the policy should wait before re-sending the request.

OnRequestSent(PipelineMessage)

A method that can be overridden by derived types to extend the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) just after control has been returned from the policy at the position after the retry policy in the pipeline.

OnRequestSentAsync(PipelineMessage)

A method that can be overridden by derived types to extend the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) just after control has been returned from the policy at the position after the retry policy in the pipeline.

OnSendingRequest(PipelineMessage)

A method that can be overridden by derived types to extend the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) prior to passing control to the next policy in the pipeline.

OnSendingRequestAsync(PipelineMessage)

A method that can be overridden by derived types to extend the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) prior to passing control to the next policy in the pipeline.

OnTryComplete(PipelineMessage)

A method that can be overridden by derived types to extend the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) after the time interval for the current retry attempt has passed.

Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32)

Process the provided PipelineMessage according to the intended purpose of this PipelinePolicyinstance. Derived types must pass control to the next PipelinePolicy in the pipeline by calling ProcessNext(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32).

ProcessAsync(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32)

Process the provided PipelineMessage according to the intended purpose of this PipelinePolicyinstance. Derived types must pass control to the next PipelinePolicy in the pipeline by calling ProcessNextAsync(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32).

ShouldRetry(PipelineMessage, Exception)

A method that can be overridden by derived types to customize the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) after control has been returned from the policy at the position after the retry policy in the pipeline.

ShouldRetryAsync(PipelineMessage, Exception)

A method that can be overridden by derived types to customize the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) after control has been returned from the policy at the position after the retry policy in the pipeline.

Wait(TimeSpan, CancellationToken)

A method that can be overridden by derived types to customize the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) to wait the time interval returned by GetNextDelay(PipelineMessage, Int32).

WaitAsync(TimeSpan, CancellationToken)

A method that can be overridden by derived types to customize the default ClientRetryPolicy logic. It is called from Process(PipelineMessage, IReadOnlyList<PipelinePolicy>, Int32) to wait the time interval returned by GetNextDelay(PipelineMessage, Int32).

Applies to