docs.rs failed to build open-coroutine-0.6.11
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
open-coroutine-0.7.0
open-coroutine
The open-coroutine
is a simple, efficient and generic stackful-coroutine library.
English | δΈζ
π Features
- Preemptive(
not supported in windows
): even if the coroutine enters a dead loop, it can still be seized, see example; - Hook: you are free to use most of the slow syscall in coroutine, see supported syscall on unix/windows;
- Scalable: the size of the coroutine stack supports unlimited expansion without the cost of copying stack, and immediately shrinks to the original size after use, see example;
- io_uring(
only in linux
): supports and is compatible with io_uring in terms of local file IO and network IO. If it's not supported on your system, it will fall back to non-blocking IO; - Priority: support custom task priority, note that coroutine priority is not open to users;
- Work Steal: internally using a lock free work steal queue;
- Compatibility: the implementation of open-coroutine is no async, but it is compatible with async, which means you can use this crate in
tokio/async-std/smol/...
; - Platforms: running on Linux, macOS and Windows;
π Roadmap
- cancel coroutine/task;
- add metrics;
- add synchronization toolkit;
- support and compatibility for AF_XDP socket;
π Quick Start
step1: add dependency to your Cargo.toml
[]
# check https://crates.io/crates/open-coroutine
= "x.y.z"
step2: add open_coroutine::main
macro
step3: create a task
create a task with priority(optional)
wait until the task is completed or timed out(optional)
scalable stack(optional)