Table of Contents

Interface ICircuitBreakerPolicy

Namespace
WorkflowForge.Extensions.Resilience.Abstractions
Assembly
WorkflowForge.Extensions.Resilience.dll

Interface for circuit breaker policies.

public interface ICircuitBreakerPolicy : IDisposable
Inherited Members

Properties

State

Gets the current state of the circuit breaker.

CircuitBreakerState State { get; }

Property Value

CircuitBreakerState

Methods

ExecuteAsync(Func<Task>, CancellationToken)

Executes the specified operation through the circuit breaker.

Task ExecuteAsync(Func<Task> operation, CancellationToken cancellationToken = default)

Parameters

operation Func<Task>

The operation to execute.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous operation.

Exceptions

CircuitBreakerOpenException

Thrown when the circuit breaker is open.

Events

StateChanged

Occurs when the circuit breaker state changes.

event EventHandler<CircuitBreakerStateChangedEventArgs>? StateChanged

Event Type

EventHandler<CircuitBreakerStateChangedEventArgs>