svrnty-mcp-gateway/src/Svrnty.MCP.Gateway.Core/Interfaces/ICircuitBreaker.cs
Svrnty 19ef79362e refactor: rename OpenHarbor.MCP to Svrnty.MCP across all libraries
- Renamed all directories: OpenHarbor.MCP.* → Svrnty.MCP.*
- Updated all namespaces in 179 C# files
- Renamed 20 .csproj files and 3 .sln files
- Updated 193 documentation references
- Updated 33 references in main CODEX codebase
- Updated Codex.sln with new paths
- Build verified: 0 errors

Preparing for extraction to standalone repositories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 21:04:17 -04:00

31 lines
1.2 KiB
C#

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