Class TimeoutResiliencePipelineBuilderExtensions
- Namespace
- Polly
- Assembly
- Polly.Core.dll
Extensions for adding timeout to ResiliencePipelineBuilder.
public static class TimeoutResiliencePipelineBuilderExtensions
- Inheritance
-
TimeoutResiliencePipelineBuilderExtensions
- Inherited Members
Methods
AddTimeout<TBuilder>(TBuilder, TimeoutStrategyOptions)
Adds a timeout to the builder.
public static TBuilder AddTimeout<TBuilder>(this TBuilder builder, TimeoutStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builder
TBuilderThe builder instance.
options
TimeoutStrategyOptionsThe timeout options.
Returns
- TBuilder
The same builder instance.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
oroptions
is null.- ValidationException
Thrown when
options
are invalid.
AddTimeout<TBuilder>(TBuilder, TimeSpan)
Adds a timeout to the builder.
public static TBuilder AddTimeout<TBuilder>(this TBuilder builder, TimeSpan timeout) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builder
TBuilderThe builder instance.
timeout
TimeSpanThe timeout value. This value should be greater than Zero.
Returns
- TBuilder
The same builder instance.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
is null.- ValidationException
Thrown when the options produced from the arguments are invalid.