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

Method ensure_buffer

nodedb/src/event/cdc/router.rs:237–244  ·  view source on GitHub ↗

Ensure a buffer exists for a given key (stream or topic). Creates if missing.

(
        &self,
        tenant_id: u64,
        name: &str,
        retention: &super::stream_def::RetentionConfig,
    )

Source from the content-addressed store, hash-verified

235
236 /// Ensure a buffer exists for a given key (stream or topic). Creates if missing.
237 pub fn ensure_buffer(
238 &self,
239 tenant_id: u64,
240 name: &str,
241 retention: &super::stream_def::RetentionConfig,
242 ) -> Arc<StreamBuffer> {
243 self.get_or_create_buffer(tenant_id, name, retention)
244 }
245
246 /// Get a buffer for a stream (if it exists). Used by consumers to poll events.
247 pub fn get_buffer(&self, tenant_id: u64, stream_name: &str) -> Option<Arc<StreamBuffer>> {

Callers 1

Calls 1

get_or_create_bufferMethod · 0.80

Tested by

no test coverage detected