nio-task 0.1.0

async task implementation
Documentation

Nio Task

Nio Task is a low-level task abstraction designed for building executors. It gives you explicit control over how and when a task is polled and rescheduled.

Crates.io Documentation License: Apache-2.0

Example

Add this to your Cargo.toml file:

[dependencies]

nio-task = "0.1"

use nio_task::{Status, Task};

let metadata = 0;
let future = async {};
let scheduler = |task| {
    // ...
};

let (task, join) = Task::new_with(metadata, future, scheduler);

match task.poll() {
    Status::Yielded(task) => task.schedule(),
    Status::Pending => {}
    Status::Complete(_metadata) => {}
}