Admission + prefetch orchestration in front of a DemandGeometryQueue.

Consumers request() products as demand changes (the pump owns admission — don't request on the queue directly); each async pump() cycle:

  1. selects the top-priority pending batch,
  2. awaits source residency for the batch (failures re-queue for retry and are reported, never thrown — one bad range must not stall the viewport),
  3. forwards the resident products to the queue and runs its synchronous pump under the same batch cap.

Re-entrant calls coalesce: a pump() while one is in flight returns the in-flight cycle's promise rather than interleaving prefetch batches. Products already resident in the queue skip prefetch entirely (their ranking refresh is forwarded immediately).

Constructors

Accessors

Methods

Constructors

  • Parameters

    • queue_: DemandGeometryQueue

      The synchronous demand queue (extraction + budget).

    • prefetcher_: ResidencyPrefetcher

      Source-byte residency (the model / buffer provider).

    • batch_: number = DEFAULT_BATCH

      Max products prefetched + extracted per pump cycle.

    Returns DemandResidencyPump

Accessors

  • get pendingCount(): number
  • Returns number

    Products awaiting admission (not yet prefetched).

Methods

  • Run one admission cycle (see class docs). Coalesces with an in-flight cycle.

    Returns Promise<PumpResult>

    The cycle's outcome.

  • Request a product at a demand priority. Resident products forward immediately (ranking refresh); others queue for the next pump cycle at the highest priority requested so far.

    Parameters

    • productLocalID: number

      The product to materialise.

    • priority: number

      The demand priority (higher = more wanted).

    Returns void