13 releases

0.3.7 Aug 8, 2022
0.3.6 Apr 24, 2022
0.3.3 Jul 27, 2021
0.3.2 Mar 26, 2021
0.1.2 Mar 23, 2021

#234 in Embedded development

Download history 5/week @ 2023-12-11 12/week @ 2023-12-18 7/week @ 2023-12-25 11/week @ 2024-01-08 3/week @ 2024-01-15 3/week @ 2024-01-22 13/week @ 2024-02-05 9/week @ 2024-02-12 27/week @ 2024-02-19 30/week @ 2024-02-26 28/week @ 2024-03-04 24/week @ 2024-03-11 30/week @ 2024-03-18 37/week @ 2024-03-25

119 downloads per month
Used in 9 crates (3 directly)

Custom license

12KB
152 lines

Task-Stream

task-stream is a global task executor, can run in no_std.

Usage

spawn

async fn async_task() {
    println!("async_task.");
}
task_stream::spawn(async_task());

executor

without async executor

use core::time::Duration;
use std::thread;

fn main() {
    let stream = task_stream::stream();
    loop {
        while let Some(task) = stream.get_task() {
            task.run();
        }
        thread::sleep(Duration::from_millis(100));
    }
}

use async executor

use async_std::prelude::*;
use async_std::task;

fn main() {
    task::spawn(async {
        let mut stream = task_stream::stream();
        while let Some(task) = stream.next().await {
            task.run();
        }
    });
}

Dependencies

~0.7–1MB
~18K SLoC