#executor #async-task #async-executor #bare-metal #async #no-std

no-std exo_task

A lightweight async task executor for bare metal (or any) systems

3 releases

new 0.1.2 Feb 13, 2025
0.1.1 Feb 13, 2025
0.1.0 Feb 13, 2025

#587 in Embedded development

Download history 371/week @ 2025-02-11

371 downloads per month

MIT/Apache

15KB
162 lines

exo_task

A lightweight async task executor for bare metal (or any) systems, supporting no_std environments.

Features

  • Fully no_std compatible (requires alloc)
  • Two executor implementations:
    • Simple FIFO-based executor for basic needs
    • Advanced executor with proper waking mechanisms
  • Configurable platform support (x86_64 feature flag)
  • Efficient task management with unique task IDs
  • Waker caching for better performance

Usage

Add this to your Cargo.toml:

[dependencies]
exo_task = "0.1.2"

For x86_64 platform support without std:

[dependencies]
exo_task = { version = "0.1.2", default-features = false, features = ["x86_64"] }

Example

use exo_task::{Task, SimpleExecutor};

async fn example_task() {
    // Your async code here
}

let mut executor = SimpleExecutor::new();
executor.spawn(Task::new(example_task()));
executor.run();

Requirements

  • Rust nightly
  • Working allocator implementation

License

Licensed under either of:

at your option.

Note: This licensing applies only to the current branch.

Credits

This crate is based on Philipp Oppermann's Async/Await implementation from his "Writing an OS in Rust" series, adapted into a standalone crate for broader use.

Documentation and comments were enhanced using GitHub Copilot while preserving the original code functionality.

Contributing

Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Status

This project is currently in development. API may change between versions.

Dependencies

~125–275KB