@xylabs/threads
Version:
Web workers & worker threads as simple as a function call
14 lines • 680 B
TypeScript
import type { ImplementationExport } from '../types/master.ts';
/** Default thread pool size based on available hardware concurrency, falling back to 4. */
export declare const defaultPoolSize: number;
/**
* Get the browser-specific worker implementation, 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 web worker context.
* @returns True if running in a worker, false otherwise.
*/
export declare function isWorkerRuntime(): boolean;
//# sourceMappingURL=implementation.browser.d.ts.map