pub struct RoomEffects {
policy_before_transport: bool,
transport: RoomTransportPlan,
output: RoomOutputPlan,
source_policy: SourcePolicyTurn,
}Expand description
batches post-lock transport, signaling and policy side-effects for room state transitions
room state mutation (holds RoomState write lock)
- mutate in-memory graph
- return commit data
|
v drop RoomState write lock
RoomEffects::from_*(commit) -> execute_inner
|
v step 1: transport execution
+-----------------------------------------------------------+
| - create/remove local consumer routes on workers |
| - register/remove cross-worker relay route targets |
| - dispatch session teardowns |
+-----------------------------------------------------------+
|
v step 2: RoomOutputPlan pre-policy fanout
+-----------------------------------------------------------+
| - send track snapshots and presence user-info fanout |
+-----------------------------------------------------------+
|
v step 3: source policy turn
+-----------------------------------------------------------+
| - re-evaluate audio admission and video bandwidth solver |
| - commit packet gate and BWE target updates |
+-----------------------------------------------------------+
|
v step 4: RoomOutputPlan post-policy fanout
+-----------------------------------------------------------+
| - send user-info and lifecycle close/track/fanout output |
+-----------------------------------------------------------+The diagram shows the normal batch order. Only an active ProducerActivityCommit from
from_publication_activity runs its pre-policy user-info output and source policy before transport.
Callers of from_publish and from_publication_activity use
execute_with_source_policy_guard while holding source_policy_turn.
Fields§
§policy_before_transport: bool§transport: RoomTransportPlan§output: RoomOutputPlan§source_policy: SourcePolicyTurnImplementations§
Source§impl RoomEffects
impl RoomEffects
pub(in engine::room) fn from_join( commit: JoinCommit, ) -> Self
pub(in engine::room) fn from_connection_close( commit: ConnectionCloseCommit, ) -> Self
pub(in engine::room) fn from_disconnect( commit: DisconnectCommit, ) -> Self
pub(in engine::room) fn from_presence( commit: PresenceCommit, ) -> Self
pub(in engine::room) fn from_publish( commit: PublishCommit, ) -> Self
pub(in engine::room) fn from_publication_activity( commit: ProducerActivityCommit, ) -> Self
pub(in engine::room) fn from_receiver_intent( commit: ReceiverRouteCommit, ) -> Self
pub(in engine::room) fn from_consumer_readiness( commit: ReceiverRouteCommit, ) -> Self
fn push_presence_before_policy(&mut self, presence: Option<PresenceCommit>)
fn from_receiver_route( work: ReceiverRouteWork, origin: ConsumerSetupOrigin, ) -> Self
Sourcepub async fn execute(self, room: &Room, context: RoomEffectContext<'_>)
pub async fn execute(self, room: &Room, context: RoomEffectContext<'_>)
preserves the room-wide side-effect order across transport and policy work
pub(in engine::room) async fn execute_with_source_policy_guard( self, room: &Room, context: RoomEffectContext<'_>, )
async fn execute_inner( self, room: &Room, context: RoomEffectContext<'_>, source_policy_guarded: bool, )
Trait Implementations§
Source§impl Debug for RoomEffects
impl Debug for RoomEffects
Source§impl Default for RoomEffects
impl Default for RoomEffects
Source§fn default() -> RoomEffects
fn default() -> RoomEffects
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RoomEffects
impl RefUnwindSafe for RoomEffects
impl Send for RoomEffects
impl Sync for RoomEffects
impl Unpin for RoomEffects
impl UnsafeUnpin for RoomEffects
impl UnwindSafe for RoomEffects
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
§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