/** * Batch Processor * Handles batch request processing with concurrency control and result aggregation */ import { EventEmitter } from 'events'; import { BatchJob, BatchJobCreate, BatchJobFilter, BatchRequestResult, BatchProgress } from './types'; export interface BatchProcessorConfig { /** Default max concurrency */ defaultMaxConcurrency?: number; /** Default request timeout (ms) */ defaultRequestTimeout?: number; /** Default batch timeout (ms) */ defaultBatchTimeout?: number; /** Auto-cleanup expired jobs after N days */ autoCleanupDays?: number; /** Storage for batch files */ storage?: { type: 's3' | 'gcs' | 'local'; bucket?: string; path?: string; }; } export declare class BatchProcessor extends EventEmitter { private config; private jobs; private activeProcessors; private results; constructor(config?: BatchProcessorConfig); /** * Create and start batch job */ createJob(jobData: BatchJobCreate): Promise; /** * Start processing batch job */ private startProcessing; /** * Process requests with concurrency control */ private processRequests; /** * Process single request */ private processRequest; /** * Finalize job (aggregation, storage, etc.) */ private finalizeJob; /** * Calculate batch statistics */ private calculateStats; /** * Aggregate results */ private aggregateResults; /** * Store results to storage */ private storeResults; /** * Call webhook */ private callWebhook; /** * Get job by ID */ getJob(jobId: string): BatchJob | undefined; /** * Get job results */ getResults(jobId: string): BatchRequestResult[]; /** * Get job progress */ getProgress(jobId: string): BatchProgress | null; /** * List jobs with filters */ listJobs(filter?: BatchJobFilter): BatchJob[]; /** * Cancel job */ cancelJob(jobId: string): BatchJob; /** * Delete job and its results */ deleteJob(jobId: string): Promise; /** * Cleanup expired jobs */ cleanup(): Promise; /** * Shutdown processor */ shutdown(): void; /** * Call model provider API */ private callModelProvider; /** * Helper: Generate unique ID */ private generateId; } //# sourceMappingURL=processor.d.ts.map