Private ReadonlypendingPending 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).
PrivatependingPrivate ReadonlyinCurrently-running task promises (for drain()).
PrivatedroppedPrivatepumpingPrivate ReadonlyconcurrencyPrivate ReadonlymaxPrivate ReadonlymaxPrivate StaticresolveResolve 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.
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).
PrivatepumpStart tasks up to the concurrency cap.
Drop all pending (not-yet-started) tasks. In-flight tasks continue — the caller neutralizes their effect via its own staleness guard. Used on cache invalidation / dispose.
Await every pending + in-flight task to finish. Primarily for tests and an
optional teardown flush; the queue otherwise self-drains via pump().
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).