Asynchronous programming library for MoonBit
moon add moonbitlang/async@0.16.4async fn[X] with_task_group(async (TaskGroup[X]) -> X) -> X#deprecated("this error is no longer emitted")
pub suberror AlreadyTerminated
impl Show for AlreadyTerminatedpub suberror TimeoutError
type Lazy[X]pub(all) enum RetryMethod {
Immediate
FixedDelay(Int)
ExponentialDelay(Int, Double, Int)
}type Task[X]type TaskGroup[X]fn[X] TaskGroup::spawn_loop(self : TaskGroup[X], f : async () -> IterResult, no_wait? : Bool, allow_failure? : Bool, retry? : RetryMethod, max_retry? : Int, fatal_error? : (Error) -> Bool) -> Unitfn is_cancellation_error(error : Error) -> Boolfn now() -> Int64async fn[X] protect_from_cancel(f : async () -> X, resume_on_cancel? : Bool) -> Xasync fn[X] retry(strategy : RetryMethod, max_retry? : Int, fatal_error? : (Error) -> Bool, f : async () -> X) -> Xfn run_async_main(main : async () -> Unit) -> Unit#deprecated("use `async fn main` or `async test` instead")
fn with_event_loop(f : async (TaskGroup[Unit]) -> Unit) -> Unit raiseasync fn[X] with_timeout(time : Int, f : async () -> X, error? : Error) -> Xasync fn[X] with_timeout_opt(time : Int, f : async () -> X) -> X?Asynchronous programming library for MoonBit