MCPcopy Create free account
hub / github.com/andywer/threads.js / selectWorkerImplementation

Function selectWorkerImplementation

src/master/implementation.node.ts:255–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253let isTinyWorker: boolean
254
255function selectWorkerImplementation(): ImplementationExport {
256 try {
257 isTinyWorker = false
258 return initWorkerThreadsWorker()
259 } catch(error) {
260 // tslint:disable-next-line no-console
261 console.debug("Node worker_threads not available. Trying to fall back to tiny-worker polyfill...")
262 isTinyWorker = true
263 return initTinyWorker()
264 }
265}
266
267export function getWorkerImplementation(): ImplementationExport {
268 if (!implementation) {

Callers 1

getWorkerImplementationFunction · 0.70

Calls 2

initWorkerThreadsWorkerFunction · 0.85
initTinyWorkerFunction · 0.85

Tested by

no test coverage detected