Skip to main content

read_pending_for_parent

Function read_pending_for_parent 

Source
pub async fn read_pending_for_parent(
    pool: &Pool,
    parent_agent_instance_hierarchy: &str,
    after_id: Option<i64>,
    limit: Option<i64>,
) -> Result<Vec<ResponseItem>, Error>
Expand description

Materialize every unread objectiveai.messages row for the children spawned by parent_agent_instance_hierarchy (per objectiveai.messages_queue watermarks), coalesced into ResponseItem blocks. Bumps each affected child’s read_index to GREATEST(current, max_returned) atomically in the same SQL statement.