notifies 0.1.0

various efficient async notifies
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::{
    sync::atomic::{AtomicBool, Ordering::Relaxed},
    task::Poll,
};

#[inline]
pub fn try_ready(flag: &AtomicBool) -> Poll<()> {
    if flag.swap(false, Relaxed) {
        Poll::Ready(())
    } else {
        Poll::Pending
    }
}