pub mod async_wrapper;
pub use async_wrapper::Async;
mod context;
pub use context::{block_on, block_on_or_add_sub_task, yield_now, Context};
mod join;
pub use join::JoinHandle;
pub mod reactor;
use reactor::{Reactor, Readable, ReadableOwned, Source, Writable, WritableOwned};
#[allow(clippy::mutex_atomic)]
mod scheduler;
use scheduler::{Handle, HandleWeak, Scheduler};
mod task;
pub use task::{SubTaskOutput, TaskId};
pub mod timer;
struct CallOnDrop<F: FnOnce()>(Option<F>);
impl<F: FnOnce()> CallOnDrop<F> {
fn new(f: F) -> Self {
CallOnDrop(Some(f))
}
}
impl<F: FnOnce()> Drop for CallOnDrop<F> {
fn drop(&mut self) {
self.0.take().unwrap()()
}
}