Files
marqdo/doc/design/stdlib-subtask.md
T
cflmyandCursor 63e5be80ab Add v0.2 surface syntax, writeback/subtask stdlib, and view input deferral.
Use + for parameters, ordered-list branches, backtick identifiers, and quoted strings with escapes. Add writeback and subtask host libs, optional parameter defaults, narrative-bold comment fix, and defer view execution until preset stdin is submitted.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 17:52:33 +08:00

25 lines
742 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 子任务标准库(subtask)
| | |
|---|---|
| 状态 | v1 已落地 |
| 库 | `lib/subtask.mq.md` · `lib/子任务.mq.md` |
## 定位
OS 进程式并发:`spawn` 另起 `marqdo run <path>` 子进程;**父进程结束(含 panic)时 KillOnDrop 终止所有未 join 的子进程**。
v1 不共享 Marqdo 堆;子任务通过 stdout / 文件 / 环境通信。
## API
| EN | ZH | 说明 |
|----|-----|------|
| `spawn` | `启动` | `path=`(`.mq.md`) |
| `poll` | `探测` | `id=` → status map |
| `wait` | `等待` | `id=` → exit code(避免与内置 `join` 冲突) |
| `kill` | `终止` | `id=` |
| `wait_all` | `等待全部` | 所有子进程 exit codes |
Host:`host_subtask_*`(`src/host/subtask.rs`)。