Apply this read preference to Selection.
(self, selection: Selection)
| 428 | super().__init__(_SECONDARY_PREFERRED, tag_sets, max_staleness, hedge) |
| 429 | |
| 430 | def __call__(self, selection: Selection) -> Selection: |
| 431 | """Apply this read preference to Selection.""" |
| 432 | secondaries = secondary_with_tags_server_selector( |
| 433 | self.tag_sets, max_staleness_selectors.select(self.max_staleness, selection) |
| 434 | ) |
| 435 | |
| 436 | if secondaries: |
| 437 | return secondaries |
| 438 | else: |
| 439 | return selection.primary_selection |
| 440 | |
| 441 | |
| 442 | class Nearest(_ServerMode): |
nothing calls this directly
no test coverage detected