pub struct Cost {
pub warm: u64,
pub cold: u64,
}Expand description
What pulling content via a route costs, in two magnitudes that accumulate
together and are compared in that order: lower warm wins, and
cold breaks the tie.
Both are the same path priced against different cache states. warm is what one
more subscription would cost the mesh right now; cold prices the identical
path as if nothing were cached, so it stays meaningful once discounts have
flattened warm.
Fields§
§warm: u64The cost of pulling content via this route as the mesh stands today, accumulated per link. Lower wins.
The original publisher seeds it with its production cost (zero for a live publish, something large for a standby that would have to start working, like a cold transcoder), and each link adds its own configured price as the announcement crosses it, so a route over a metered backbone ranks worse than an equal-length one within a datacenter.
cold: u64The same path with every warm discount removed: what pulling the content would cost if no relay along it were carrying anything.
Accumulates exactly like warm but never restarts. MAX
when the peer’s wire cannot express it (pre-lite-06, or the MoQ Cluster
extension), which ranks last rather than pretending the path is free.
Implementations§
Source§impl Cost
impl Cost
Sourcepub const MAX: Self
pub const MAX: Self
The highest cost either half can take, and where accumulation saturates.
A draining session stamps this on its routes so every other candidate outranks them while they stay selectable as the last path to the content. Draining is not a distinct state: cost is the whole mechanism, and a route whose accumulated cost saturates the wire ceiling ranks (and is treated) the same way.