language · language ·

Tasks and delayed work

task starts a named function asynchronously, can carry a typed result, and can be delayed with after.

afterawaitconcurrencycpulanguageoftaskyeho

Use a task when useful work can progress independently and you can define completion, failure, cancellation, and ownership.

task name = task Work()
task of Type name = task Work()
task name = task after 100ms Work()
await name

Status: experimental

Complete tasks and delayed work example

Use a task when useful work can progress independently and you can define completion, failure, cancellation, and ownership.

cpu · language · type checked

Score() -> int { return 40 + 2 }
task of int job = task Score()
wait job
if job.failed { Console.Error(job.error.message) }
else { Console.Log(Text.From(job.result)) }
project.mech
manifestVersion = "2"
package = "api.example.language__tasks"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"
Notes and source

Task, parallel, and tunnel behavior varies by target and remains experimental.

Do not discard a task unless its lifecycle and failure are intentionally unobserved.

yeho/errors-tasks-effects-2026.1.json; tests/compiler/errors-tasks-effects/task-lifecycle/start.yh