Returns a reader connection using round-robin distribution.
(&self)
| 481 | |
| 482 | /// Returns a reader connection using round-robin distribution. |
| 483 | fn reader(&self) -> &Connection { |
| 484 | let idx = self.reader_idx.fetch_add(1, Ordering::Relaxed) % self.readers.len(); |
| 485 | #[allow(clippy::indexing_slicing)] |
| 486 | // SAFETY: idx is computed modulo readers.len(), which is always >= 1. |
| 487 | &self.readers[idx] |
| 488 | } |
| 489 | |
| 490 | /// Read a value from the `parameters` table by name, or `None` if absent. |
| 491 | async fn get_parameter(&self, name: &'static str) -> DbResult<Option<String>> { |
no outgoing calls
no test coverage detected