Whether an observer's send queue is below the backpressure threshold. Returns `false` if the observer is unknown.
(&self, observer: u64)
| 227 | /// Whether an observer's send queue is below the backpressure threshold. |
| 228 | /// Returns `false` if the observer is unknown. |
| 229 | pub fn observer_can_receive(&self, observer: u64) -> bool { |
| 230 | self.observer_states |
| 231 | .iter() |
| 232 | .find(|(id, _)| *id == observer) |
| 233 | .map(|(_, state)| state.pending_count < ObserverState::MAX_PENDING) |
| 234 | .unwrap_or(false) |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | #[cfg(test)] |
no test coverage detected