/** Number of worker threads in the pool */
export declare const WORKER_POOL_SIZE = 10;
/** Worker lifetime in milliseconds (default: 5 minutes) */
export declare const WORKER_LIFETIME_MS: number;
/** Minimum lifetime remaining before replacing worker (default: 30 seconds) */
export declare const WORKER_MIN_LIFETIME_MS: number;
/** Timeout for worker acknowledgment in milliseconds (default: 5 seconds) */
export declare const WORKER_ACK_TIMEOUT_MS: number;
/** Timeout for worker to complete task in milliseconds (default: 2 minutes) */
export declare const WORKER_TASK_TIMEOUT_MS: number;
/** Interval for checking worker expiry (default: 10 seconds) */
export declare const WORKER_EXPIRY_CHECK_INTERVAL_MS: number;
/** Maximum time a request can wait in queue (default: 30 seconds) */
export declare const QUEUE_TIMEOUT_MS: number;
interface PoolStatistics {
    requestsReceived: number;
    requestsDispatched: number;
    requestsQueued: number;
    requestsAbandoned: number;
    requestsCompleted: number;
    requestsFailed: number;
    requestsTimedOut: number;
    currentQueueSize: number;
    queueTimes: number[];
    ackTimes: number[];
    processingTimes: number[];
    successRate: number;
    timeoutRate: number;
    abandonRate: number;
}
export declare class WorkerPool {
    private readonly MAX_STATS_SIZE;
    private workers;
    private roundRobinIndex;
    private nextWorkerId;
    private workerScript;
    private expiryCheckInterval?;
    private requestQueue;
    private pendingTasks;
    private taskTimings;
    private stats;
    constructor(workerScript?: string);
    /**
     * Initialize the worker pool with the configured number of workers
     */
    private initialize;
    /**
     * Start proactive worker expiry checking
     */
    private startExpiryCheck;
    /**
     * Check all workers for expiry and proactively replace those about to expire
     */
    private checkWorkerExpiry;
    /**
     * Create a new worker and add it to the pool
     */
    private createWorker;
    /**
     * Handle messages from workers
     */
    private handleWorkerMessage;
    /**
     * Handle worker crash or unexpected termination
     */
    private handleWorkerCrash;
    /**
     * Get next available worker using round-robin strategy
     */
    private getNextAvailableWorker;
    /**
     * Replace a worker with a new one
     */
    private replaceWorker;
    /**
     * Process queued requests when workers become available
     */
    private processQueue;
    /**
     * Dispatch a task to a specific worker
     */
    private dispatchToWorker;
    /**
     * Execute a task on an available worker or queue it
     */
    executeTask(event: any): Promise<any>;
    /**
     * Shutdown the worker pool
     */
    shutdown(): Promise<void>;
    /**
     * Get basic pool statistics (worker status)
     */
    getWorkerStats(): {
        total: number;
        idle: number;
        busy: number;
        terminated: number;
    };
    /**
     * Get comprehensive pool statistics with histograms
     */
    getStats(): PoolStatistics;
    /**
     * Get statistics summary with percentiles
     */
    getStatsSummary(): string;
}
export {};
//# sourceMappingURL=worker_pool.d.ts.map