Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Module workers/worker-pool/codec-dispatch

    Batched, load-spread dispatch of blosc chunk decodes to the data workers — the BloscDecodeBackend the pool installs for data/codecs/worker-blosc.ts.

    Decodes requested in the same microtask (zarrita resolves a multi-chunk selection's chunks together; a warm L1 hands many back at once) are queued and flushed as batches of at most MAX_BATCH_CHUNKS chunks / MAX_BATCH_BYTES decoded bytes. A flush is split so the chunks spread over the IDLE WARM workers first (one batch per such worker, sized evenly) rather than piling onto one — every batch still goes through the pool's least-busy selection among warm workers, whose slot stays busy until the worker settles. A worker still warming its codec gets no batch.

    Returns null (decode locally) while the pool has no usable worker — the first paint must not wait for workers to spawn — for a chunk below MIN_OFFLOAD_DECODED_BYTES, whose decode is cheaper than the trip, and while no worker's codec is warm yet. The first chunk that clears the floor is what starts that warm-up (one worker first; see codec-warmup.ts), so a store whose chunks are all below it never makes a worker fetch its codec.

    BloscDecodeDispatcher
    CodecPoolPort
    Pending
    MAX_BATCH_CHUNKS
    MAX_BATCH_BYTES
    MIN_OFFLOAD_DECODED_BYTES
    bloscDecodedSize
    splitBatches