Table of Contents

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

foundry IWorkflowFoundry

The foundry to configure.

failureThreshold int

Number of failures before opening the circuit.

durationOfBreak TimeSpan?

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

foundry IWorkflowFoundry

The foundry to configure.

maxRetryAttempts int

Maximum number of retry attempts.

baseDelay TimeSpan?

Base delay for exponential backoff.

circuitBreakerThreshold int

Circuit breaker failure threshold.

circuitBreakerDuration TimeSpan?

Circuit breaker open duration.

timeoutDuration TimeSpan?

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

foundry IWorkflowFoundry

The foundry to configure.

settings PollyMiddlewareOptions

The 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

foundry IWorkflowFoundry

The foundry to configure.

maxRetryAttempts int

Maximum number of retry attempts.

baseDelay TimeSpan?

Base delay for exponential backoff.

maxDelay TimeSpan?

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

foundry IWorkflowFoundry

The foundry to configure.

timeout TimeSpan

The timeout duration.

Returns

IWorkflowFoundry

The foundry for method chaining.