(
&mut self,
peer_id: u64,
user_id: u64,
tenant_id: u64,
delta: Vec<u8>,
collection: String,
constraint_name: String,
attempt: u32,
| 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 | /// |
no outgoing calls