lib/task
import "github.com/eugenioenko/goalchemy/lib/task"Package task provides structured waiting for Goalchemy programs.
| Function | c | csharp | go | java | python | rust | swift | typescript |
|---|---|---|---|---|---|---|---|---|
All |
yes | yes | yes | yes | yes | yes | yes | yes |
await |
yes | yes | yes | yes | yes | yes | yes | yes |
start |
yes | yes | yes | yes | yes | yes | yes | yes |
func All(fns ...func())Run each function as a task, in order, and resume the caller when all have finished.
- Gate:
cooperative(may suspend the calling task) - Determinism: controlled
- Contract:
lib.task.all1.0.0
func await(future FutureState) []anyWait for a future and return its cached results.
- Gate:
cooperative(may suspend the calling task) - Determinism: controlled
- Errors: Errors are ordinary result values.
- Contract:
lib.task.await1.0.0
func start(fn any) FutureStateStart a function as a cooperative task and retain its results.
- Gate:
sequential(never suspends) - Determinism: controlled
- Errors: Errors are ordinary result values.
- Contract:
lib.task.start1.0.0