logs-interceptor
Version:
High-performance, production-ready log interceptor for Node.js applications with Loki integration. Built with Clean Architecture principles. Supports Node.js, Browser, and Node-RED.
26 lines • 854 B
TypeScript
/**
* Infrastructure: CircuitBreakerService
* Implements circuit breaker pattern for resilience
*/
import { ICircuitBreakerService, CircuitBreakerState } from '../../domain/services/ICircuitBreakerService';
export interface CircuitBreakerConfig {
readonly enabled: boolean;
readonly failureThreshold: number;
readonly resetTimeout: number;
readonly halfOpenRequests: number;
}
export declare class CircuitBreakerService implements ICircuitBreakerService {
private readonly config;
private state;
private failures;
private successCount;
private lastFailure;
private nextAttempt;
constructor(config: CircuitBreakerConfig);
isOpen(): boolean;
recordSuccess(): void;
recordFailure(): void;
getState(): CircuitBreakerState;
reset(): void;
}
//# sourceMappingURL=CircuitBreakerService.d.ts.map