Class PollyExtensions
- Namespace
- WorkflowForge.Extensions.Resilience.Polly
- Assembly
- WorkflowForge.Extensions.Resilience.Polly.dll
Extension methods for integrating Polly middleware with WorkflowForge foundries Provides fluent API for adding enterprise-grade fault tolerance to workflow foundries.
public static class PollyExtensions
- Inheritance
-
PollyExtensions
- Inherited Members
Methods
UsePollyCircuitBreaker(IWorkflowFoundry, int, TimeSpan?)
Adds Polly circuit breaker middleware to the foundry.
public static IWorkflowFoundry UsePollyCircuitBreaker(this IWorkflowFoundry foundry, int failureThreshold = 5, TimeSpan? durationOfBreak = null)
Parameters
foundryIWorkflowFoundryThe foundry to configure.
failureThresholdintNumber of failures before opening the circuit.
durationOfBreakTimeSpan?Duration to keep the circuit open.
Returns
- IWorkflowFoundry
The foundry for method chaining.
UsePollyComprehensive(IWorkflowFoundry, int, TimeSpan?, int, TimeSpan?, TimeSpan?)
Adds comprehensive Polly middleware combining retry, circuit breaker, and timeout.
public static IWorkflowFoundry UsePollyComprehensive(this IWorkflowFoundry foundry, int maxRetryAttempts = 3, TimeSpan? baseDelay = null, int circuitBreakerThreshold = 5, TimeSpan? circuitBreakerDuration = null, TimeSpan? timeoutDuration = null)
Parameters
foundryIWorkflowFoundryThe foundry to configure.
maxRetryAttemptsintMaximum number of retry attempts.
baseDelayTimeSpan?Base delay for exponential backoff.
circuitBreakerThresholdintCircuit breaker failure threshold.
circuitBreakerDurationTimeSpan?Circuit breaker open duration.
timeoutDurationTimeSpan?Operation timeout duration.
Returns
- IWorkflowFoundry
The foundry for method chaining.
UsePollyFromSettings(IWorkflowFoundry, PollyMiddlewareOptions)
Adds Polly middleware based on configuration settings.
public static IWorkflowFoundry UsePollyFromSettings(this IWorkflowFoundry foundry, PollyMiddlewareOptions settings)
Parameters
foundryIWorkflowFoundryThe foundry to configure.
settingsPollyMiddlewareOptionsThe Polly settings to apply.
Returns
- IWorkflowFoundry
The foundry for method chaining.
UsePollyRetry(IWorkflowFoundry, int, TimeSpan?, TimeSpan?)
Adds Polly retry middleware to the foundry with exponential backoff.
public static IWorkflowFoundry UsePollyRetry(this IWorkflowFoundry foundry, int maxRetryAttempts = 3, TimeSpan? baseDelay = null, TimeSpan? maxDelay = null)
Parameters
foundryIWorkflowFoundryThe foundry to configure.
maxRetryAttemptsintMaximum number of retry attempts.
baseDelayTimeSpan?Base delay for exponential backoff.
maxDelayTimeSpan?Maximum delay between retries.
Returns
- IWorkflowFoundry
The foundry for method chaining.
UsePollyTimeout(IWorkflowFoundry, TimeSpan)
Adds Polly timeout middleware to the foundry.
public static IWorkflowFoundry UsePollyTimeout(this IWorkflowFoundry foundry, TimeSpan timeout)
Parameters
foundryIWorkflowFoundryThe foundry to configure.
timeoutTimeSpanThe timeout duration.
Returns
- IWorkflowFoundry
The foundry for method chaining.