@arrows/worker
Version:
Simple, promise-based API for native worker threads (with pools)
13 lines (12 loc) • 400 B
TypeScript
import { Worker } from "./types";
/**
* Spawns workers and returns a function that handles messaging
* and returns responses as promises.
*
* @param handler Function that performs calculations inside worker threads
* @param config Configuration options
* @returns Async function that communicates with worker threads.
*/
declare const worker: Worker;
export { worker };
export default worker;