handleJobs
handleJobs<
TIn,TOut>(fn):void
Defined in: src/modules/worker-pool/worker-pool.ts:119
Worker-side counterpart to WorkerPool: wires the message protocol so the worker script only supplies the job function. Handles both sync and async jobs and reports thrown errors back to the pool (rejecting the Promise).
Type Parameters
Section titled “Type Parameters”TIn
TOut
Parameters
Section titled “Parameters”(input) => TOut | Promise<TOut>
Returns
Section titled “Returns”void
Example
Section titled “Example”handleJobs((input: MyInput) => heavyCompute(input));