import { type Job, type JobResult } from './jobQueue.js'; /** * Job runner that allows running jobs as they are created. * This will wait for jobs to be added to it and run them up the * maximum concurrency. * * Results are available via `getResults()`. */ export declare class JobRunner> { private concurrency; private queue; private results; private activeJobs; private waitingResolvers; private workers; private isAcceptingWork; private workAvailablePromise; private resolveWorkAvailable; /** * Create a new runner with the specified concurrency. * * @param concurrency - The maximum number of jobs to run concurrently. */ constructor(concurrency: number); private worker; private waitForWorkAvailable; private ensureWorkers; private notifyWorkersOfNewWork; private checkIfIdle; /** * Add a job to the queue */ enqueue(job: Job): void; /** * Add multiple jobs to the queue */ enqueueAll(jobs: Job[]): void; /** * Returns a promise that resolves when all queued work is complete */ waitForIdle(): Promise; /** * Get all results accumulated so far */ getResults(): JobResult[]; /** * Shutdown the queue - no new jobs will be accepted, but existing jobs will complete. * * Returns when a promise that resolves when all jobs have been processed and * are available in `getResults()`. */ finishAllWork(): Promise; /** * Get the current queue length */ get queueLength(): number; /** * Get the number of currently active jobs */ get activeJobCount(): number; } //# sourceMappingURL=jobRunner.d.ts.map