UNPKG

@xylabs/threads

Version:

Web workers & worker threads as simple as a function call

14 lines 706 B
import type { ImplementationExport } from '../types/master.ts'; /** Default thread pool size based on the number of CPU cores. */ export declare const defaultPoolSize: number; /** * Get the Node.js-specific worker implementation using `worker_threads`, lazily initializing it on first call. * @returns The platform-specific worker implementation export. */ export declare function getWorkerImplementation(): ImplementationExport; /** * Check whether the current code is running inside a Node.js worker thread. * @returns True if running in a worker thread (not the main thread), false otherwise. */ export declare function isWorkerRuntime(): boolean; //# sourceMappingURL=implementation.node.d.ts.map