docs(lib): narrate remaining stdlib modules (M2)
Add module intros and per-function purpose lines across EN/ZH libs, with callable examples on the smaller modules; keep + params and host bodies intact. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
53bc3538da
commit
fecaacd5be
49 files changed
+617
-21
No files matched your search
+13
-4
@@ -3,6 +3,8 @@ title: lib/subtask
|
||||
description: Concurrent subtasks — file, function, or foreign code
|
||||
---
|
||||
|
||||
Concurrent subtasks: file, function, or foreign code.
|
||||
|
||||
## spawn
|
||||
+ `path`=None
|
||||
+ `fn`=None
|
||||
@@ -13,28 +15,35 @@ description: Concurrent subtasks — file, function, or foreign code
|
||||
+ `stdin`=None
|
||||
+ `quiet`=True
|
||||
|
||||
File children are silent by default (`quiet=True`: piped capture, no TTY noise).
|
||||
Set `quiet=False` to inherit parent stdout/stderr.
|
||||
File `wait` returns `{code, value}` plus optional `stdout`/`stderr` tails when quiet-captured.
|
||||
`value` is the child's `# main` return (not stdout).
|
||||
Start a subtask. File children are silent by default (quiet=True: piped capture). Set quiet=False to inherit parent stdout/stderr. File wait returns {code, value} plus optional stdout/stderr tails when quiet-captured. value is the child main return (not stdout).
|
||||
|
||||
Caller: [subtask.spawn] path="child.mq.md"
|
||||
|
||||
*> host_subtask_spawn path=`path` fn=`fn` args=`args` code=`code` lang=`lang` source=`source` stdin=`stdin` quiet=`quiet`*
|
||||
|
||||
## poll
|
||||
+ `id`
|
||||
|
||||
Non-blocking status for subtask id.
|
||||
|
||||
*> host_subtask_poll id=`id`*
|
||||
|
||||
## wait
|
||||
+ `id`
|
||||
|
||||
Block until subtask id finishes.
|
||||
|
||||
*> host_subtask_join id=`id`*
|
||||
|
||||
## kill
|
||||
+ `id`
|
||||
|
||||
Kill subtask id.
|
||||
|
||||
*> host_subtask_kill id=`id`*
|
||||
|
||||
## wait_all
|
||||
|
||||
Wait until every spawned subtask finishes.
|
||||
|
||||
*> host_subtask_wait_all*
|
||||
Reference in new issue
Block a user