Runs a task on a pool worker for the given task module, creating the pool lazily on first use.
Module specifier of a task module that calls
defineWorkerTask
Structured-clonable task input
Optionaloptions: WorkerRunOptions
Per-call options
The task's structured-clonable output
Terminates every worker in every pool and rejects pending tasks. Called
by the plugin's onClose hook; safe to call more than once.
Returns a snapshot of every pool created so far.
One TaskPoolStats per task module
A pool of worker threads executing task modules off the event loop.
A task module is an ES module owned by the application that registers its handler via
defineWorkerTask(from@setu-ts/runtime/worker). Tasks are addressed by module specifier — never by closure, because functions cannot cross a thread boundary. Inputs and outputs travel by structured clone.Example
Since
0.1.0