RecordSink

Trait RecordSink 

Source
pub trait RecordSink: Send + Sync {
    // Required method
    fn deliver_batch<'life0, 'async_trait>(
        &'life0 self,
        batch: Bytes,
        records: usize,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

One flushed batch’s delivery destination (DW-121). Deliberately small — one method, one batch, one answer — because the pipeline’s guarantees (ordering, bounded memory, drop-and-count) live in the FLUSHER, not in the sink: an implementation only decides where a batch goes and whether the receiver took it.

webhook is the one shipped implementation (WebhookRecordSink); a Kafka producer is the documented second slot (see the module docs and the config enum’s), deferred by the lean-deps rule. Implementations must enforce their OWN delivery budget: the flusher calls deliver_batch inline and in order, so a sink without a timeout is a stuck queue.

Required Methods§

Source

fn deliver_batch<'life0, 'async_trait>( &'life0 self, batch: Bytes, records: usize, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deliver one flushed NDJSON batch of records lines. Returns whether the batch was accepted (2xx on some attempt for the webhook sink) — the flusher only logs; outcome counting is the implementation’s, in the metric family it owns.

Implementors§