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

    A per-instance bounded-concurrency FIFO write queue with per-key coalescing. Models the acquire/release/FIFO shape of utils/fetch-concurrency.ts, but is per-instance, configurable, and bounded by both task count and retained bytes (that gate is an unbounded global singleton).

    Index
    pending: Map<string, { run: () => Promise<void>; byteLength: number }> = ...

    Pending tasks keyed by cache key. Map insertion order IS the FIFO order; re-enqueuing a key coalesces (the latest task wins and moves to newest).

    pendingBytes: number = 0
    inFlightPromises: Set<Promise<void>> = ...

    Currently-running task promises (for drain()).

    droppedCount: number = 0
    pumping: boolean = false
    concurrency: number
    maxDepth: number
    maxBytes: number
    • Resolve one configured limit: finite, floored, at least 1. All three go through here because Math.max(1, Math.floor(NaN)) is NaN, and each limit fails differently and silently on a NaN — size < NaN is false, so a non-finite concurrency means the pump never starts a task (total L2 write loss) while a non-finite maxDepth/maxBytes simply removes that bound. Every one of them is reachable through MultiLevelCachingStore's opfsWrite* options, which bypass the config validators.

      Parameters

      • value: number

      Returns number

    • Schedule a write. Returns synchronously; the task runs in the background when a concurrency slot frees. Re-enqueuing the same key replaces its pending task (coalesce, keep-latest). Past maxDepth or maxBytes, THIS arrival is dropped and the already-pending tasks are left to drain in order (see the module docstring for why the oldest end is the one worth keeping).

      Parameters

      • key: string
      • run: () => Promise<void>
      • byteLength: number

      Returns void