web-csv-toolbox - v0.14.0
    Preparing search index...

    Interface WorkerPool

    Common interface for worker pools. Both ReusableWorkerPool and TransientWorkerPool implement this interface.

    This interface defines the contract for worker pool implementations. Users typically use ReusableWorkerPool for persistent worker pools, while the internal default pool uses TransientWorkerPool for automatic cleanup.

    interface WorkerPool {
        size: number;
        "[dispose]"(): void;
        getNextRequestId(): number;
        getWorker(workerURL?: string | URL): Promise<Worker>;
        isFull(): boolean;
        releaseWorker(worker: Worker): void;
        terminate(): void;
    }
    Index

    Properties

    size: number

    Get the current number of workers in the pool.

    The number of active workers

    Methods

    • Dispose of the worker pool, terminating all workers.

      Returns void

    • Get the next request ID for this pool.

      Returns number

      The next request ID

    • Check if the pool has reached its maximum capacity.

      Returns boolean

      True if the pool is at maximum capacity, false otherwise

    • Terminate all workers in the pool and clean up resources.

      Returns void