node-worker-threads-pool
Version:
Simple worker threads pool using Node's worker_threads module. Compatible with ES6+ Promise, Async/Await.
11 lines (10 loc) • 371 B
TypeScript
/// <reference types="node" />
import { Worker } from 'worker_threads';
import { TaskConfig } from './taskContainer';
export declare class PoolWorker extends Worker {
ready: boolean;
constructor(...args: ConstructorParameters<typeof Worker>);
run(param: any, taskConfig: TaskConfig): Promise<any>;
private readyToWork;
terminate(): Promise<number>;
}