ChunkFillPool
A pool of chunk-fill workers, from makeChunkFillPool: a ChunkFillSource for makeChunkedWorld({ fill }).
Defined in: engine/src/worker/chunks.ts:196
Extends
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
capacity | readonly | number | How 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.capacity | engine/src/chunks.ts:88 |
pending | readonly | number | Requests not yet settled (queued or running). | - | engine/src/worker/chunks.ts:211 |
size | readonly | number | Number 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
| Parameter | Type |
|---|---|
boxes | readonly Box[] |
opts? | { signal?: AbortSignal; } |
opts.signal? | AbortSignal |
Returns
Promise<FilledBricks>
Overrides
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>