pub struct Receiver { /* private fields */ }Expand description
Consumer handle for the blocking event channel.
Not cloneable — single consumer. Provides blocking recv
and recv_timeout in addition to non-blocking
try_recv.
Blocking methods use a three-phase wait: fast poll → backoff (snooze) → park. The receiver parks when idle and is woken by the sender on new notifications.
Obtained from event_channel().
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn recv(&self, events: &mut Events)
pub fn recv(&self, events: &mut Events)
Block until events are ready, then drain all into the buffer.
Three-phase wait: poll (fast path) → backoff (snooze) → park. Returns when at least one event is available.
Sourcepub fn recv_limit(&self, events: &mut Events, limit: usize)
pub fn recv_limit(&self, events: &mut Events, limit: usize)
Block until events are ready, then drain up to limit.
Same three-phase wait. Returns when at least one event is available. Oldest notifications drain first (FIFO).
Sourcepub fn recv_timeout(&self, events: &mut Events, timeout: Duration) -> bool
pub fn recv_timeout(&self, events: &mut Events, timeout: Duration) -> bool
Block until events are ready, with timeout.
Returns true if events were received, false if the timeout
elapsed with no events.
Sourcepub fn recv_timeout_limit(
&self,
events: &mut Events,
limit: usize,
timeout: Duration,
) -> bool
pub fn recv_timeout_limit( &self, events: &mut Events, limit: usize, timeout: Duration, ) -> bool
Block until events are ready, with timeout and limit.
Returns true if events were received, false if the timeout
elapsed with no events.
Sourcepub fn try_recv(&self, events: &mut Events)
pub fn try_recv(&self, events: &mut Events)
Non-blocking poll. Same as Poller::poll.
Sourcepub fn try_recv_limit(&self, events: &mut Events, limit: usize)
pub fn try_recv_limit(&self, events: &mut Events, limit: usize)
Non-blocking poll with limit. Same as Poller::poll_limit.