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) to be used 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.
Feature Flags
| Feature | Default | Description |
|---|---|---|
exec_async_std |
no | Enables: async-std, async-std/default |
exec_embassy |
no | Enables: embassy-executor, embassy-time |
exec_smol |
no | Enables: smol |
exec_tokio |
no | Enables: tokio, tokio/time, tokio/rt |
hyper_executor |
no | Hyper integration — pair with an exec_* feature (e.g. exec_tokio) |
moment |
no | Time abstraction utilities |
default features: chrono/clock
Installation
[]
= "0.0.1"
Pin the version to match the crate Cargo.toml when using path or git dependencies.
Documentation
Full API documentation is available at docs.rs/product-os-async-executor.
Usage
Overview
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.
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.20", = ["exec_tokio"] }
= { = "1", = ["rt", "rt-multi-thread", "macros", "time"] }
Quick Start
Using with Tokio
use ;
async
Using Timers
use ;
async
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
Contributing
Contributions are not currently available but will be available on a public repository soon.
License
This project is licensed under the GNU GPLv3.