namespace Svrnty.MCP.Gateway.Core.Interfaces;
///
/// Defines the contract for circuit breaker implementations.
/// Provides fault tolerance by preventing cascading failures.
///
public interface ICircuitBreaker
{
///
/// Executes an operation with circuit breaker protection.
/// If the circuit is open (too many failures), the operation is not executed.
///
/// Return type of the operation.
/// The operation to execute.
/// Cancellation token.
/// The result of the operation.
/// Thrown when the circuit is open.
Task ExecuteAsync(Func> operation, CancellationToken cancellationToken = default);
///
/// Gets the current state of the circuit breaker.
///
/// The current state ("Closed", "Open", or "HalfOpen").
string GetState();
///
/// Manually resets the circuit breaker to the closed state.
///
void Reset();
}