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

#300 in Embedded development

Download history 64/week @ 2022-08-05 39/week @ 2022-08-12 33/week @ 2022-08-19 24/week @ 2022-08-26 42/week @ 2022-09-02 46/week @ 2022-09-09 22/week @ 2022-09-16 27/week @ 2022-09-23 60/week @ 2022-09-30 41/week @ 2022-10-07 9/week @ 2022-10-14 25/week @ 2022-10-21 52/week @ 2022-10-28 54/week @ 2022-11-04 44/week @ 2022-11-11 42/week @ 2022-11-18

193 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

~1MB
~18K SLoC