pub struct Poller { /* private fields */ }Expand description
Consumer handle for polling ready tokens.
Not cloneable — single consumer. Pops tokens from the FIFO queue in notification arrival order.
Obtained from event_queue().
Implementations§
Source§impl Poller
impl Poller
Sourcepub fn poll(&self, events: &mut Events)
pub fn poll(&self, events: &mut Events)
Drain all ready tokens into the events buffer.
Pops from the MPSC queue until empty. Clears the per-token flag for each drained token (allowing future re-notification).
The events buffer is cleared then filled. Tokens appear in notification arrival order (FIFO).
Sourcepub fn poll_limit(&self, events: &mut Events, limit: usize)
pub fn poll_limit(&self, events: &mut Events, limit: usize)
Drain up to limit ready tokens into the events buffer.
Pops from the MPSC queue up to limit times. Remaining
items stay in the queue for the next poll/poll_limit call.
Tokens appear in notification arrival order (FIFO). Prevents starvation: oldest notifications drain first.
If limit is 0, the events buffer is cleared and no tokens
are drained.