pub struct RoomWorkerPolicy {
max_local_routers: usize,
packet_loop_delay_threshold_ms: u64,
}Expand description
Same-room router cap and packet-loop health threshold.
Only running workers are eligible. A room’s first join selects the first
healthy worker in its cyclic search order or the least-delayed running worker
when none qualify. 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. Otherwise, the
least-delayed running assigned worker is reused. Missing delay samples and
values at or above packet_loop_delay_threshold_ms are unhealthy.
Placements on failed workers do not count toward the cap. When no assigned
worker is running, a join attaches a fresh placement on another running worker,
even with the single-router policy. If no worker is running, admission returns
RoomManagerJoinError::NoUsableWorker.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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
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>
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>
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