Skip to main content

Crate tasky

Crate tasky 

Source
Expand description

Fluent async task experiments

Read more about it in the “postfix spawn” post. This is an experiment moving tasks from a model where “tasks are async threads” to a model where: “tasks are parallel futures”.

This means tasks will no longer start unless explicitly .awaited, dangling tasks become a thing of the past, and by default async Rust will act structurally concurrent.

§Examples

use tasky::prelude::*;

async_std::task::block_on(async {
    let res = async { "nori is a horse" }
        .spawn()
        .name("meow".into())
        .await;
    assert_eq!(res, "nori is a horse");
})

Modules§

prelude
The tasky prelude.

Structs§

Builder
Task builder that configures the settings of a new task.
ParallelFuture
A handle representing a task.

Traits§

FutureExt
Extend the Future trait.