go 0.1.1

A runtime-agnostic Go-style concurrency library for Rust
Documentation
//! # go
//!
//! A runtime-agnostic Go-style concurrency library for Rust.
//!
//! Select your async runtime at compile time via Cargo features:
//!
//! ```toml
//! [dependencies]
//! go = { version = "0.1", features = ["rt-tokio"] }   # or rt-async-std, rt-smol
//! ```
//!
//! ## Primitives
//!
//! - [`spawn`] / [`go!`] — fire-and-forget async task spawn
//! - [`chan`] — bounded and unbounded channels
//! - [`select!`] — multiplex channel recv operations
//! - [`WaitGroup`] — wait for a group of tasks to complete
//! - [`sleep`] / [`timeout`] — async timers
//! - [`singleflight::Group`] — deduplicate concurrent calls by key

#[cfg(not(any(feature = "rt-tokio", feature = "rt-async-std", feature = "rt-smol")))]
compile_error!("go: exactly one runtime feature must be enabled (rt-tokio, rt-async-std, or rt-smol)");

#[cfg(any(
    all(feature = "rt-tokio", feature = "rt-async-std"),
    all(feature = "rt-tokio", feature = "rt-smol"),
    all(feature = "rt-async-std", feature = "rt-smol"),
))]
compile_error!("go: exactly one runtime feature must be enabled — multiple selected");

mod backend;
mod spawn;
mod time;
pub mod chan;
mod waitgroup;
mod select;
pub mod singleflight;

pub use spawn::{spawn, JoinHandle, JoinError};
pub use time::{sleep, timeout, Elapsed};
pub use waitgroup::{WaitGroup, WaitGroupGuard};