pub struct Notifier { /* private fields */ }Expand description
Producer handle for signaling token readiness.
Cloneable for multiple producers (MPSC pattern). Each notify()
first checks the per-token dedup flag — if already set, the
notification is conflated (single atomic swap, no queue push).
Otherwise, the flag is set and the token index is pushed to the
FIFO queue.
Obtained from event_queue().
Implementations§
Source§impl Notifier
impl Notifier
Sourcepub fn notify(&self, token: Token) -> Result<(), NotifyError>
pub fn notify(&self, token: Token) -> Result<(), NotifyError>
Notify that a token is ready.
If this token is already flagged (not yet consumed by the poller),
this is a no-op — the notification is conflated. Returns Ok(()).
Returns Err(NotifyError) if the internal queue push fails.
This should never happen (the per-token flag prevents more entries
than capacity), but if it does, the flag is cleared so future
notifications to this token can retry.
Wait-free on the conflation path (single atomic swap). Lock-free on the push path (CAS on queue tail).