7 releases
0.3.2 | Sep 16, 2024 |
---|---|
0.3.1 | Sep 16, 2024 |
0.2.2 | Sep 16, 2024 |
0.1.1 | Sep 16, 2024 |
0.1.0 | Mar 6, 2024 |
#1439 in Asynchronous
70 downloads per month
8KB
188 lines
A even smaller tokio
Features
- Basic task spawning and execution
- Asynchronous runtime with a simple event loop
- Custom
Future
implementation for delays - Thread-safe task scheduling using channels
Usage
To use mini-tokio in your Rust project:
- Create a new
Runtime
instance - Spawn tasks using the
block_on
function - Or use the mini_tokio::main attribute
Examples:
use mini_tokio::Runtime;
let rt = Runtime::new();
mini_tokio.block_on(async {
// Your async code here
});
#[mini_tokio::main]
async fn main() {
// Your async code here
}
Note
This is a minimal implementation for educational purposes and is not intended for production use. For real-world applications, consider using the full Tokio runtime or other production-ready async runtimes.
Dependencies
~330–800KB
~18K SLoC