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

Method drain_responses

nodedb-bridge/src/async_bridge.rs:167–173  ·  view source on GitHub ↗

Drain up to `max` responses into the buffer.

(&mut self, buf: &mut Vec<Rsp>, max: usize)

Source from the content-addressed store, hash-verified

165
166 /// Drain up to `max` responses into the buffer.
167 pub fn drain_responses(&mut self, buf: &mut Vec<Rsp>, max: usize) -> usize {
168 let count = self.consumer.drain_into(buf, max);
169 if count > 0 {
170 let _ = self.rsp_wake.producer_wake.notify();
171 }
172 count
173 }
174
175 /// Current backpressure state.
176 pub fn pressure(&self) -> PressureState {

Callers 1

Calls 2

drain_intoMethod · 0.45
notifyMethod · 0.45

Tested by 1