maf 0.1.0-alpha.6

MAF is an authoritative realtime framework for writing simple, secure, and scalable apps.
Documentation
//! Task spawning for different environments.

#[cfg(not(feature = "native"))]
mod wasi;

#[cfg(feature = "native")]
mod native {
    use std::future::IntoFuture;

    pub fn spawn<T: IntoFuture + 'static>(fut: T) -> tokio::task::JoinHandle<T::Output>
    where
        T::IntoFuture: Send,
        T::Output: Send,
    {
        tokio::spawn(fut.into_future())
    }
}

#[cfg(feature = "native")]
pub use native::*;
#[cfg(not(feature = "native"))]
pub use wasi::*;