Product OS : Async Executor
Product OS : Async Executor provides a set of tools to handle async execution generically so that the desired async library (e.g. Tokio, Smol, Async-std) can be chosen at compile time.
What is Product OS?
Product OS is a collection of packages that provide different tools and features that can work together to build products more easily for the Rust ecosystem.
Features
- Generic Executor Traits: Define common interfaces for working with different async runtimes
- Runtime Support: Out-of-the-box support for Tokio, Smol, and Async-std
- Timer Support: One-time and interval timers that work across runtimes
- Async I/O Traits:
AsyncReadandAsyncWritetraits for cross-runtime I/O - No-std Support: Works in
no_stdenvironments with alloc - Hyper Integration: Optional executor integration for Hyper
Installation
Add Product OS : Async Executor to your Cargo.toml:
[]
= { = "0.0.17", = ["exec_tokio"] }
= { = "1", = ["rt", "rt-multi-thread", "macros", "time"] }
Quick Start
Using with Tokio
use ;
async
Using Timers
use ;
async
Feature Flags
default: Minimalno_stdsupport with alloc and clockexec_tokio: Enable Tokio executor supportexec_smol: Enable Smol executor supportexec_async_std: Enable Async-std executor supportexec_embassy: Enable Embassy executor support (embedded)moment: Enable time abstraction utilitieshyper_executor: Enable Hyper executor integration
Core Traits
Executor
The Executor trait provides a unified interface for creating and managing executor contexts:
use ;
async
ExecutorPerform
The ExecutorPerform trait provides methods for spawning and blocking on tasks:
use ;
async
Timer
The Timer trait provides cross-runtime timer functionality:
use ;
async
Testing
# Run tests with Tokio executor
# Run tests with all features
# Generate documentation
License
Contributing
Contributions are welcome! Please ensure:
- All tests pass:
cargo test --all-features - Code is formatted:
cargo fmt - No clippy warnings:
cargo clippy --all-features - Documentation is updated for public APIs
Minimum Supported Rust Version (MSRV)
Rust 1.69 or later.