Function: processQueueMessages()
Makaio Framework / ai-adapters-core / processQueueMessages
Function: processQueueMessages()
Section titled “Function: processQueueMessages()”processQueueMessages<
TExtra>(queue,callbacks):Promise<boolean>
Defined in: ../../../adapters/core/src/session/process-queue.ts:100
Shared processQueue orchestration for all session implementations.
Handles the complete immediate-mode flow:
- Detect immediate message while a turn is active
- Pause the active turn
- Supersede the in-flight message and drain enqueued messages
- Collect merged content from all superseded/merged messages
- Start a new turn with the immediate message and merged context
Also handles the normal queue flow:
- Late immediate rejection (immediate arrives after turn finishes)
- Normal enqueue/replace message processing
Returns true when a new turn was started, false otherwise.
Callers can use this to decide whether to transition to idle when
the queue drains without starting a new turn (e.g., all-rejection case).
Type Parameters
Section titled “Type Parameters”TExtra
Section titled “TExtra”TExtra = unknown
Type of adapter-specific extra merge data
Parameters
Section titled “Parameters”The user message queue to process
callbacks
Section titled “callbacks”ProcessQueueCallbacks<TExtra>
Adapter-specific callbacks
Returns
Section titled “Returns”Promise<boolean>
True if a new turn was started, false otherwise