voxolith

ChunkFillPool

A pool of chunk-fill workers, from makeChunkFillPool: a ChunkFillSource for makeChunkedWorld({ fill }).

Defined in: engine/src/worker/chunks.ts:196

Extends

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
capacityreadonlynumberHow many requests are worth having out at once (a pool: its workers times the requests each keeps queued). The world hands out no more than this, so the rest of its queue stays in its own nearest-first order and follows the focus.ChunkFillSource.capacityengine/src/chunks.ts:88
pendingreadonlynumberRequests not yet settled (queued or running).-engine/src/worker/chunks.ts:211
sizereadonlynumberNumber of workers.-engine/src/worker/chunks.ts:209

Methods

destroy()

destroy(): void;

Defined in: engine/src/worker/chunks.ts:207

Terminate the workers; pending requests reject with an AbortError.

Returns

void


fill()

fill(boxes: readonly Box[], opts?: object): Promise<FilledBricks>;

Defined in: engine/src/worker/chunks.ts:203

Fill every brick overlapping boxes on the next free worker. Rejects when the fill throws, the worker dies running it (it is replaced), make failed, the request is aborted (with signal.reason) or the pool is destroyed (an AbortError). An aborted request that is already running still runs; its result is dropped.

Parameters

ParameterType
boxesreadonly Box[]
opts?{ signal?: AbortSignal; }
opts.signal?AbortSignal

Returns

Promise<FilledBricks>

Overrides

ChunkFillSource.fill


ready()

ready(): Promise<void>;

Defined in: engine/src/worker/chunks.ts:205

Resolves once every worker has built its fill; rejects if make failed.

Returns

Promise<void>

On this page