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

Method poll_ready

nodedb-crdt/src/deferred.rs:118–132  ·  view source on GitHub ↗

Poll for entries ready for retry. Returns all entries whose `next_retry_ms <= now_ms`.

(&mut self, now_ms: u64)

Source from the content-addressed store, hash-verified

116 ///
117 /// Returns all entries whose `next_retry_ms <= now_ms`.
118 pub fn poll_ready(&mut self, now_ms: u64) -> Vec<DeferredEntry> {
119 let mut ready = Vec::new();
120
121 while let Some(front) = self.entries.front() {
122 if front.next_retry_ms <= now_ms
123 && let Some(entry) = self.entries.pop_front()
124 {
125 ready.push(entry);
126 } else {
127 break;
128 }
129 }
130
131 ready
132 }
133
134 /// Expire entries past their TTL deadline.
135 ///

Calls 3

frontMethod · 0.80
pop_frontMethod · 0.80
pushMethod · 0.45