pub enum LinkSelection {
Auto,
FirstSuccess,
Random,
}Expand description
How Pool::call/Pool::publish order the pool’s currently-connected
links before applying their own existing first-match/replication_factor
logic — changes ORDER only, never how many links get used. Matches
macula_client.erl’s own link_selection option (first_success/
random) and macula-go/macula-dotnet’s identically-named enum, so
config ported from any of those doesn’t need re-learning.
Variants§
Auto
(The default.) Derives the actual policy from
StationDiscoveryOptions::enabled: FirstSuccess
if discovery is off (this pool’s original, only behavior, unchanged),
Random if it’s on.
FirstSuccess
Tries links in Seed-list order (bootstrap seeds in the order the
caller gave them, then discovered links in discovery order) — this
pool’s baseline behavior, since links is a plain append-only
Vec (see Pool’s own doc on why that, not a HashMap, is the
backing store — insertion order is the ordering, nothing extra to
track).
Random
Uniformly shuffles the connected-links list before the same
first-match (Call) or take-first-N (Publish) logic runs. Composes
safely with a small replication_factor: shuffling ahead of a
1-element slice is a no-op.
Trait Implementations§
Source§impl Clone for LinkSelection
impl Clone for LinkSelection
Source§fn clone(&self) -> LinkSelection
fn clone(&self) -> LinkSelection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more