UNPKG

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 833 B
/** * Infrastructure: Circuit Breaker Implementation */ import { ICircuitBreaker, CircuitBreakerState } from '../../domain/interfaces/ICircuitBreaker'; export interface CircuitBreakerConfig { readonly enabled: boolean; readonly failureThreshold: number; readonly resetTimeout: number; readonly halfOpenRequests: number; } export declare class CircuitBreaker implements ICircuitBreaker { private readonly config; private state; private failures; private successCount; private lastFailure?; private nextAttempt?; constructor(config: CircuitBreakerConfig); execute<T>(operation: () => Promise<T>): Promise<T>; recordSuccess(): void; recordFailure(): void; getState(): CircuitBreakerState; reset(): void; private isOpen; } //# sourceMappingURL=CircuitBreaker.d.ts.map