Worker-side task helper — the ONLY framework code that runs inside a worker
thread, published as the @setu-ts/runtime/worker subpath so task
modules can import it without pulling in the runtime plugin barrel.
Application task modules call defineWorkerTask at module top
level; the WorkerPoolPlugin's pool spawns workers of that module and speaks
the shared protocol from @setu-ts/common to them.
f
defineWorkerTask<TInput, TOutput>(fn: (input: TInput) => TOutput | Promise<TOutput>): void
Registers this module's task handler. Call once, at module top level, in a module that the WorkerPoolPlugin executes:
Usage
import * as mod from "runtime/src/worker/define-worker-task.ts";