MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / flush

Method flush

nodedb/src/control/trigger/batch/collector.rs:298–311  ·  view source on GitHub ↗

Flush the pending batch, returning it if non-empty.

(&mut self)

Source from the content-addressed store, hash-verified

296
297 /// Flush the pending batch, returning it if non-empty.
298 pub fn flush(&mut self) -> Option<TriggerBatch> {
299 self.pending.take().and_then(|p| {
300 if p.rows.is_empty() {
301 None
302 } else {
303 Some(TriggerBatch {
304 collection: p.collection,
305 operation: p.operation,
306 rows: p.rows,
307 tenant_id: p.tenant_id,
308 })
309 }
310 })
311 }
312
313 /// Check if there is a pending batch with rows.
314 pub fn has_pending(&self) -> bool {

Callers 3

pushMethod · 0.45
flush_partial_batchFunction · 0.45

Calls 2

takeMethod · 0.45
is_emptyMethod · 0.45

Tested by 2

flush_partial_batchFunction · 0.36