Hyperlinkv0.8.0-beta.28

NodeWorker

(
  spawn: (id: number) => WorkerThreads.Worker | ChildProcess.ChildProcess
): Layer.Layer<Worker.WorkerPlatform | Worker.Spawner>

Provides the Node WorkerPlatform together with a Worker.Spawner created from the supplied worker or child-process spawning function.

layers
export const layer = (
  spawn: (id: number) => WorkerThreads.Worker | ChildProcess.ChildProcess
): Layer.Layer<Worker.WorkerPlatform | Worker.Spawner> =>
  Layer.merge(
    Worker.layerSpawner(spawn),
    layerPlatform
  )