brepjs API Reference
    Preparing search index...

    Interface WorkerPool

    interface WorkerPool {
        size: number;
        dispose(): void;
        execute(
            operation: string,
            shapesBrep: string[],
            params: Record<string, unknown>,
        ): Promise<WorkerResult>;
        executeBatch(
            operations: readonly WorkerOperation[],
        ): Promise<WorkerResult[]>;
        inFlight(): readonly number[];
        init(): Promise<void>;
    }
    Index

    Properties

    size: number

    Number of workers in the pool.

    Methods

    • Dispose every worker, rejecting all pending and future operations. Idempotent.

      Returns void

    • Run one operation on the least-loaded worker.

      Parameters

      • operation: string
      • shapesBrep: string[]
      • params: Record<string, unknown>

      Returns Promise<WorkerResult>

    • In-flight task count per worker, indexed as the pool was constructed.

      Returns readonly number[]

    • Initialize every worker (load WASM) in parallel. Atomic: if any worker fails, the pool disposes every worker and rejects with the original error, leaving the pool in a terminal disposed state.

      Returns Promise<void>