pub struct RoomWorkerPolicy {
max_local_routers: usize,
packet_loop_delay_threshold_ms: u64,
}Expand description
Same-room router cap and packet-loop health threshold.
A room’s first join selects the first healthy worker in its cyclic search
order or the least-delayed worker when none qualify. With more than one local
router allowed, later joins prefer the least-delayed healthy assigned worker.
If none qualifies, another router may be allocated on an unused healthy
worker up to max_local_routers and the worker count. Missing delay samples
and values at or above packet_loop_delay_threshold_ms are unhealthy. If no
healthy placement exists, the least-delayed assigned worker is reused.
Fields§
§max_local_routers: usize§packet_loop_delay_threshold_ms: u64Implementations§
Source§impl RoomWorkerPolicy
impl RoomWorkerPolicy
pub const DEFAULT_PACKET_LOOP_DELAY_THRESHOLD_MS: u64 = 20
pub const fn strict_single_router() -> RoomWorkerPolicy
pub const fn new( max_local_routers: NonZero<usize>, packet_loop_delay_threshold_ms: NonZero<u64>, ) -> RoomWorkerPolicy
pub const fn max_local_routers(self) -> usize
pub const fn packet_loop_delay_threshold_ms(self) -> u64
Trait Implementations§
Source§impl Clone for RoomWorkerPolicy
impl Clone for RoomWorkerPolicy
Source§fn clone(&self) -> RoomWorkerPolicy
fn clone(&self) -> RoomWorkerPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoomWorkerPolicy
impl Debug for RoomWorkerPolicy
Source§impl Default for RoomWorkerPolicy
impl Default for RoomWorkerPolicy
Source§fn default() -> RoomWorkerPolicy
fn default() -> RoomWorkerPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for RoomWorkerPolicy
impl PartialEq for RoomWorkerPolicy
impl Copy for RoomWorkerPolicy
impl Eq for RoomWorkerPolicy
impl StructuralPartialEq for RoomWorkerPolicy
Auto Trait Implementations§
impl Freeze for RoomWorkerPolicy
impl RefUnwindSafe for RoomWorkerPolicy
impl Send for RoomWorkerPolicy
impl Sync for RoomWorkerPolicy
impl Unpin for RoomWorkerPolicy
impl UnsafeUnpin for RoomWorkerPolicy
impl UnwindSafe for RoomWorkerPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more