The worker pool service registered under CAPABILITIES.WORKER_POOL.
Resolves the worker host once: an injected options.host wins over the
runtime's IRuntimeServices.workers. When neither exists (e.g. Cloudflare
Workers), the service still constructs — run() throws
WorkerPoolUnavailableError, stats() returns [], and
shutdown() resolves — so one codebase stays deployable everywhere.
WorkerPoolService(options: WorkerPoolPluginOptions | undefined,runtime: IRuntimeServices,collector?: WorkerPoolCollector)
run<TInput, TOutput>(taskModule: string,input: TInput,options?: WorkerRunOptions): Promise<TOutput>
Runs a task on the pool for taskModule, creating it lazily.
shutdown(): Promise<void>
Shuts down every pool (terminating workers, rejecting pending tasks). Safe to call more than once.
stats(): readonly TaskPoolStats[]
Returns a snapshot of every pool created so far.