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

Method drain_requests

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

Drain up to `max` requests into the buffer.

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

Source from the content-addressed store, hash-verified

213
214 /// Drain up to `max` requests into the buffer.
215 pub fn drain_requests(&mut self, buf: &mut Vec<Req>, max: usize) -> usize {
216 let count = self.consumer.drain_into(buf, max);
217 if count > 0 {
218 let _ = self.req_wake.producer_wake.notify();
219 }
220 count
221 }
222
223 /// Try to send a response back to the Control Plane.
224 pub fn try_send_response(&mut self, rsp: Rsp) -> Result<()> {

Callers 1

tpc_event_loopFunction · 0.45

Calls 2

drain_intoMethod · 0.45
notifyMethod · 0.45

Tested by 1

tpc_event_loopFunction · 0.36