Table of Contents

Class WorkflowOperationPollyExtensions

Namespace
WorkflowForge.Extensions.Resilience.Polly
Assembly
WorkflowForge.Extensions.Resilience.Polly.dll

Extension methods for easily wrapping operations with Polly resilience.

public static class WorkflowOperationPollyExtensions
Inheritance
WorkflowOperationPollyExtensions
Inherited Members

Methods

WithPollyCircuitBreaker(IWorkflowOperation, int, TimeSpan?, IWorkflowForgeLogger?)

Wraps an operation with Polly circuit breaker policy.

public static PollyRetryOperation WithPollyCircuitBreaker(this IWorkflowOperation operation, int failureThreshold = 5, TimeSpan? durationOfBreak = null, IWorkflowForgeLogger? logger = null)

Parameters

operation IWorkflowOperation

The operation to wrap.

failureThreshold int

Failure threshold before opening.

durationOfBreak TimeSpan?

Duration to keep circuit open.

logger IWorkflowForgeLogger

Optional logger.

Returns

PollyRetryOperation

A Polly-wrapped operation.

WithPollyComprehensive(IWorkflowOperation, PollyMiddlewareOptions, IWorkflowForgeLogger?)

Wraps an operation with comprehensive Polly policies.

public static PollyRetryOperation WithPollyComprehensive(this IWorkflowOperation operation, PollyMiddlewareOptions settings, IWorkflowForgeLogger? logger = null)

Parameters

operation IWorkflowOperation

The operation to wrap.

settings PollyMiddlewareOptions

Polly settings configuration.

logger IWorkflowForgeLogger

Optional logger.

Returns

PollyRetryOperation

A comprehensively protected Polly-wrapped operation.

WithPollyRetry(IWorkflowOperation, int, TimeSpan?, TimeSpan?, IWorkflowForgeLogger?)

Wraps an operation with Polly retry policy.

public static PollyRetryOperation WithPollyRetry(this IWorkflowOperation operation, int maxRetryAttempts = 3, TimeSpan? baseDelay = null, TimeSpan? maxDelay = null, IWorkflowForgeLogger? logger = null)

Parameters

operation IWorkflowOperation

The operation to wrap.

maxRetryAttempts int

Maximum retry attempts.

baseDelay TimeSpan?

Base delay for exponential backoff.

maxDelay TimeSpan?

Maximum delay between retries.

logger IWorkflowForgeLogger

Optional logger.

Returns

PollyRetryOperation

A Polly-wrapped operation.