voxolith

GeneratorPoolOptions

Options for makeGeneratorPool.

Defined in: engine/src/worker/pool.ts:21

Properties

PropertyTypeDescriptionDefined in
closeTimeoutMs?numberHow long destroy() lets an idle worker finish its model-cache writes before terminating it anyway, in ms (default 10000).engine/src/worker/pool.ts:54
load?LoadTrackerReport into a load tracker under the models phase: one item per request as it is queued, a tick as each result (or error) comes back, marked cached when the worker's model cache served it and labelled with the generator id. An aborted request leaves the total, so an idle phase always reads done === total. The phase is busy while requests are pending (queued, paused or running) and ends when none are; the next request starts it again.engine/src/worker/pool.ts:41
respawnOnAbort?booleanWhen a running request is aborted, terminate its worker and start a fresh one, instead of letting the worker finish a model nobody wants. Off by default: a new worker reloads its script and generators (a few hundred ms), and model-cache writes still in progress on the old one are lost. Worth it when single models take seconds (fine scales, phones) and a game cancels often, e.g. streaming models around a moving player.engine/src/worker/pool.ts:49
size?numberWorkers to run. Defaults to one per core less one, capped at 4 — generation is memory-heavy and the main thread still needs a core to draw on.engine/src/worker/pool.ts:33
spawn() => WorkerCreates one worker. The consumer supplies this because only their bundler can resolve a worker entry: spawn: () => new Worker(new URL("./gen.worker.ts", import.meta.url), { type: "module" })engine/src/worker/pool.ts:28

On this page