Function recv_event
pub async fn recv_event(rx: &mut Receiver<SessionEvent>) -> Option<SessionEvent>Expand description
Receive the next event from a broadcast receiver, handling lag gracefully.
If the receiver falls behind (too slow to keep up with the sender), the
skipped events are logged and the next available event is returned.
Returns None when the channel is closed.
§Example
ⓘ
let mut events = handle.subscribe();
while let Some(event) = recv_event(&mut events).await {
// handle event
}