use std::cell::RefCell;
use std::collections::VecDeque;
use std::future::Future;
use std::pin::Pin;
use std::rc::Rc;
pub(crate) mod driver_backend;
pub(crate) mod future_task;
pub(crate) mod handles;
pub(crate) mod scheduler;
pub(crate) mod state;
#[cfg(test)]
pub(crate) mod test_support;
pub(crate) mod timer;
pub(crate) type LocalTask = Box<dyn FnOnce() + 'static>;
pub(crate) type SendTask = Box<dyn FnOnce() + Send + 'static>;
pub(crate) type LocalBoxFuture = Pin<Box<dyn Future<Output = ()> + 'static>>;
pub(crate) type IntervalCallback = Rc<RefCell<Box<dyn FnMut()>>>;
pub(crate) const MICROTASK_STARVATION_THRESHOLD: u64 = 1000;
pub(crate) type LocalTaskQueue = VecDeque<LocalTask>;
pub(crate) type MacroTaskQueue<T> = VecDeque<T>;
pub use driver_backend::{DriverBackend, Notifier, ReadyEvents};
#[allow(unused_imports)]
pub(crate) use future_task::{FutureTask, JoinState};
pub use handles::{
AbortHandle, IntervalHandle, JoinHandle, QueueError, ThreadHandle, TimeoutHandle, WorkerHandle,
YieldNow,
};
pub use scheduler::{
Runtime, block_on, current_thread_handle, interval, queue_future, queue_microtask, queue_task,
run, run_ready_tasks, run_until_stalled, spawn_worker, timeout, yield_now,
};
pub(crate) use scheduler::{try_current_thread_handle, with_current_driver_any};
#[allow(unused_imports)]
pub(crate) use state::{ChildWorker, MacroTask, ThreadShared, ThreadState, WorkerCompletion};