toktor 0.2.1

A small tokio-based Actor framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use tokio::sync::mpsc::Receiver;
use tokio::task::yield_now;

pub async fn read_totals(rx: &mut Receiver<usize>) -> usize {
    let mut total = 0;
    while let Some(num) = rx.recv().await {
        total += num;
    }
    total
}

pub async fn yield_task() {
    yield_now().await;
}