pub struct EventReader { /* private fields */ }Expand description
The consumer half of one subscription — C’s per-monitor view of event_read,
and the single owner of the EVENTS_OFF drain-or-suspend decision. Both CA
server monitor loops and every in-process consumer reach the gate through
here, so they cannot disagree about what a pause does.
Dropping it cancels the subscription’s queue slot (C db_cancel_event),
releasing its ring entries and its quota.
Implementations§
Source§impl EventReader
impl EventReader
Sourcepub async fn recv(&mut self) -> Option<MonitorEvent>
pub async fn recv(&mut self) -> Option<MonitorEvent>
Await this subscription’s next event, suspending exactly where C’s
event_read does (flowCtrlMode && nDuplicates == 0, no drain pass in
flight). None = producer gone and queue drained.
Sourcepub fn try_recv(&mut self) -> Result<MonitorEvent, TryRecvError>
pub fn try_recv(&mut self) -> Result<MonitorEvent, TryRecvError>
Non-blocking Self::recv.
Sourcepub fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<Option<MonitorEvent>>
pub fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<Option<MonitorEvent>>
Poll-based Self::recv: Poll::Ready(None) where recv() returns
None, Poll::Pending with cx’s waker registered on the queue
where recv() suspends. For consumers that multiplex many
subscriptions from one task (the QSRV group drain) — the waker stays
registered until EvQue::wake_readers flushes it, so a caller that
polled several readers and parked is woken by whichever queue changes
first.