Polly integration for WorkflowForge providing advanced resilience patterns including circuit breakers, retries, timeouts, bulkhead isolation, and rate limiting for robust workflow execution.
$ dotnet add package WorkflowForge.Extensions.Resilience.PollyAdvanced resilience extension for WorkflowForge using the battle-tested Polly library. Provides circuit breakers, retry policies, timeout management, and rate limiting.
dotnet add package WorkflowForge.Extensions.Resilience.Polly
using WorkflowForge.Extensions.Resilience.Polly;
// Create foundry and apply Polly resilience (extension methods are on IWorkflowFoundry)
var config = FoundryConfiguration.ForProduction();
var foundry = WorkflowForge.CreateFoundry("MyWorkflow", config);
// Preset:
foundry.UsePollyProductionResilience();
// Or custom policies:
foundry
.UsePollyRetry(maxRetryAttempts: 5, baseDelay: TimeSpan.FromSeconds(1))
.UsePollyCircuitBreaker(failureThreshold: 3, durationOfBreak: TimeSpan.FromMinutes(1))
.UsePollyTimeout(TimeSpan.FromSeconds(30));
// Configuration from strongly-typed settings
var settings = PollySettings.ForProduction();
foundry.UsePollyFromSettings(settings);
Advanced resilience patterns for robust workflows