juggle
Async task switching for
cooperative multitasking
in single thread environments with no_std support.
This library provides tools to dynamically manage group of tasks in single threaded or embedded
environments. Note than this is not an operating system but can serve as a simple replacement
where you don't need context switches, for example on embedded applications.
Tasks use async/await mechanisms of Rust and it's programmer job to insert switching
points into them. Luckily this crate provides Yield utility for this as well as
handling busy waits. Primary scheduler (Wheel) can dynamically spawn, suspend, resume
or cancel tasks managed by round robin algorithm.
Crate by default uses std library (feature std) but also can be configured
as #![no_std] with alloc crate, this disables some features in utils
module.
Examples
Simple program that reads data from sensor and processes it.
use *;
use VecDeque;
use RefCell;
async
async