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

Method enqueue

nodedb-crdt/src/deferred.rs:80–113  ·  view source on GitHub ↗
(
        &mut self,
        peer_id: u64,
        user_id: u64,
        tenant_id: u64,
        delta: Vec<u8>,
        collection: String,
        constraint_name: String,
        attempt: u32,
    

Source from the content-addressed store, hash-verified

78 /// * `ttl_secs` — seconds from now until this entry expires
79 #[allow(clippy::too_many_arguments)]
80 pub fn enqueue(
81 &mut self,
82 peer_id: u64,
83 user_id: u64,
84 tenant_id: u64,
85 delta: Vec<u8>,
86 collection: String,
87 constraint_name: String,
88 attempt: u32,
89 max_retries: u32,
90 now_ms: u64,
91 first_retry_after_ms: u64,
92 ttl_secs: u64,
93 ) -> u64 {
94 let id = self.next_id;
95 self.next_id += 1;
96
97 let entry = DeferredEntry {
98 id,
99 peer_id,
100 user_id,
101 tenant_id,
102 delta,
103 collection,
104 constraint_name,
105 attempt,
106 max_retries,
107 next_retry_ms: now_ms + first_retry_after_ms,
108 ttl_deadline_ms: now_ms + (ttl_secs * 1000),
109 };
110
111 self.entries.push_back(entry);
112 id
113 }
114
115 /// Poll for entries ready for retry.
116 ///

Callers 8

enqueue_and_poll_readyFunction · 0.45
expire_past_ttlFunction · 0.45
exponential_backoffFunction · 0.45
max_retries_respectedFunction · 0.45
fifo_orderingFunction · 0.45
capacity_limitFunction · 0.45
clear_empties_queueFunction · 0.45
validate_with_policyMethod · 0.45

Calls

no outgoing calls

Tested by 7

enqueue_and_poll_readyFunction · 0.36
expire_past_ttlFunction · 0.36
exponential_backoffFunction · 0.36
max_retries_respectedFunction · 0.36
fifo_orderingFunction · 0.36
capacity_limitFunction · 0.36
clear_empties_queueFunction · 0.36