Skip to main content

records_into_work_batch

Function records_into_work_batch 

Source
pub fn records_into_work_batch<T: CommitToken>(
    records: Vec<Record>,
    commit_tokens: Vec<T>,
) -> WorkBatch<T>
Available on crate features worker-batch or worker-pool or worker only.
Expand description

Drain accumulated Records into a WorkBatch for push-ingest sources.

Push-ingest transports (HTTP, gRPC) accumulate Records via a BatchAccumulator<Record> and, on drain, must turn the drained block into the canonical WorkBatch currency to feed the engine driver. This helper is that bridge: it pairs the drained records with the caller-supplied source commit tokens (the per-request responders / acks) into one block.

Additive – the generic BatchAccumulator / BatchDrainer core is untouched; this is a free function over the Record element type. The commit_tokens are supplied by the caller because the push source owns the ack (an HTTP responder, a gRPC stream slot) – the accumulator only carries the payload records.