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

Method drop

nodedb-client/src/native/pool.rs:209–218  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

207
208impl Drop for PooledConnection<'_> {
209 fn drop(&mut self) {
210 if let Some(conn) = self.conn.take() {
211 // Synchronous return to idle queue — no async, no spawned tasks.
212 let mut idle = self.inner.idle.lock().unwrap_or_else(|e| e.into_inner());
213 if idle.len() < self.inner.max_size {
214 idle.push_back(conn);
215 }
216 // else: too many idle connections — drop this one.
217 }
218 }
219}
220
221#[cfg(test)]

Callers

nothing calls this directly

Calls 3

lockMethod · 0.80
takeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected