makeModelCache()
The model cache on any CacheStore: keys are prefixed with salt, entries are deflated, and maxBytes evicts by last use after each write. openModelCache is this on IndexedDB. Throws a RangeError on a maxBytes that is not a positive finite number, and warns about doubtful ones...
function makeModelCache(
store: CacheStore,
salt: string,
opts?: ModelCacheOptions,
now?: () => number
): ModelCache;Defined in: engine/src/worker/cache.ts:373
The model cache on any CacheStore: keys are prefixed with salt, entries are deflated,
and maxBytes evicts by last use after each write. openModelCache is this on IndexedDB.
Throws a RangeError on a maxBytes that is not a positive finite number, and warns about
doubtful ones (ModelCacheOptions.maxBytes).
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
store | CacheStore | undefined | - |
salt | string | undefined | - |
opts? | ModelCacheOptions | {} | - |
now? | () => number | Date.now | The clock for created / lastUsed (default Date.now); tests pass their own. |
Returns
makeGeneratorPool()
Run entity generators on a pool of workers, main-thread side. Generation is pure CPU work, so doing it here keeps the render thread free and spreads it across cores. Each worker runs serveGenerators with its own registry; the pool queues requests and hands each to the next free worker....
makeModelCacheControls()
ModelCacheControls on any CacheStore. openModelCacheControls is this on IndexedDB.