Methods

(static) init() → {void}

Returns:
Type: 
void

(static) processNewChildren(pool) → {void}

Read all unprocessed children (ApiResultNodes appended by fetchRes callers), extract their request AAs, add to the internal FIFO queue, and dispatch. Periodically prunes processed children to prevent unbounded accumulation.

Parameters:
NameTypeDescription
poolobject
Returns:
Type: 
void

(static) runQueueLoop() → {void}

FIFO request queue coordinator (Architecture C — continuous-server).

Receives ApiResultNode children appended by fetchRes() callers. Each node carries the request AA on its 'request' field. The coordinator reads ALL unprocessed children when woken up, dispatches each to the first free ApiTask pool slot, then routes the completed response back to the ApiResultNode so the orchestrator unblocks.

Why children instead of a shared field: SceneGraph can coalesce port events when multiple Task threads write to the same field in rapid succession — the coordinator would see fewer events than writes, silently losing requests. Children are immune: even if wakeup events coalesce, the coordinator reads ALL pending children from the node tree, so no request is ever lost regardless of timing.

Startup ordering guarantee:

  1. Each ApiTask pool slot sets isReady=true after registering its request observer.
  2. This coordinator waits for ALL pool slots to be ready before registering its own observers and setting isReady=true.
  3. fetchRes() waits for this coordinator's isReady=true before appending children. Result: pool observers → coordinator ready → fetchRes appends. No startup race.

Thread safety: Only this task thread reads/writes m.queue, m.inFlight, and m.processedIndex — no TOCTOU race. Child appends from other threads go through SceneGraph rendezvous.

Returns:
Type: 
void

(static) tryDispatch(pool) → {void}

Dispatch queued requests to free pool slots (FIFO). Only ever called from this coordinator's task thread — no concurrent access.

Parameters:
NameTypeDescription
poolobject
Returns:
Type: 
void