Skip to main content

Module room

Module room 

Source
Expand description

room manager, room runtime and user-session integration types

this facade is the server crate’s entry point for admitting users, sending outbound messages and reading room statistics pure routing and transport details remain behind the room API

§Slow-consumer shutdown

room::UserOutboundSender::send queues output without waiting for capacity when the queue is full it also records an overflow sentinel room::UserOutboundReceiver::recv_event returns that sentinel before output that was already queued the caller should stop normal draining after room::UserOutboundEvent::Overflow

let (sender, mut receiver) =
    UserOutboundSender::channel(1, Arc::new(RuntimeMetrics::default()));
let departed = |id| {
    UserOutbound::Message(RoomEventMessage::UserDeparted {
        user_id: UserId::Integer(id),
    })
};
let queued_output = departed(1);
assert!(sender.send(queued_output).is_ok());

assert!(matches!(
    sender.send(departed(2)),
    Err(UserOutboundSendError::Full(_))
));
assert!(matches!(
    receiver.recv_event().await,
    UserOutboundEvent::Overflow(_)
));

Structs§

BroadcastPayload
IncomingBitrateSnapshot
JoinUserRequest
Existing users replace their current connection without consuming another admission slot.
RemoteTrack
One track a connection consumes. The room knows no MID: the session adds it once an offer has bound consumer_media.
RemoteTrackSnapshot
Room
One room lifetime, known by two identities fixed at construction:
RoomAdmissionPolicy
admission limits that stay fixed for one room lifetime
RoomConfig
external room config passed in from the http or runtime edge
RoomDetailCapture
Passive room state required by room detail diagnostics.
RoomManager
Coordinates current room admission and lifecycle.
RoomMediaCounts
RoomOverviewCapture
Passive facts required by summary and room-list diagnostics.
RoomRuntimePolicy
stable runtime policy bundle shared by the room and its state model
RoomUserAdmission
committed admission result returned after join-side effects run
RoomUserCapture
Passive room and user facts for one room-scoped user lookup.
RoomUserStatsSnapshot
RoomUsersCapture
Passive room user inventory used by room-user and worker diagnostics.
RuntimeRoomDirectorySnapshot
current room directory row used by diagnostics views
RuntimeRoomStatsSnapshot
operator-facing room stats assembled from directory and transport snapshots
UserOutboundOverflow
queue overflow details captured when a user cannot accept more outbound work
UserOutboundQueueLimits
message and byte capacity for one user outbound queue
UserOutboundReceiver
UserOutboundSender

Enums§

BroadcastPayloadError
RoomEventMessage
RoomJoinError
RoomManagerJoinError
RoomManagerServeError
UserCloseReason
UserOutbound
room output that belongs to one connected user
UserOutboundEvent
receiver-side queue event for user-session loops
UserOutboundOverflowKind
outbound queue limit that rejected a message
UserOutboundSendError
non-blocking outbound send failure

Constants§

DEFAULT_USER_OUTBOUND_QUEUE_BYTE_CAPACITY
DEFAULT_USER_OUTBOUND_QUEUE_CAPACITY