(message: WorkerRunner.PlatformMessage<I>)
| 59 | } |
| 60 | const port = WorkerThreads.parentPort ?? process |
| 61 | function onMessage(message: WorkerRunner.PlatformMessage<I>) { |
| 62 | if (message[0] === 0) { |
| 63 | const result = handler(0, message[1]) |
| 64 | if (Effect.isEffect(result)) { |
| 65 | const fiber = runFork(result) |
| 66 | fiber.addObserver(onExit) |
| 67 | trackFiber(fiber) |
| 68 | } |
| 69 | } else { |
| 70 | if (WorkerThreads.parentPort) { |
| 71 | WorkerThreads.parentPort.close() |
| 72 | } else { |
| 73 | process.channel?.unref() |
| 74 | } |
| 75 | Deferred.doneUnsafe(closeLatch, Exit.void) |
| 76 | } |
| 77 | } |
| 78 | port.on("message", onMessage) |
| 79 | |
| 80 | function onMessageError(cause: unknown) { |
nothing calls this directly
no test coverage detected