Synchronous process management for MoonBit: spawn with env/cwd/redirection, waitpid and pidfd waits, kill, procfs sampling and platform probes
Dependencies
| 接口 Interface | 说明 Description |
|---|---|
| spawn(spec) | 启动子进程返回 pid;Spawn a child, return pid |
| wait_child / wait_child_timeout / drain_child | 回收;Reaping, deadline-bounded variants |
| pidfd_open / pidfd_alive / pidfd_exited / wait_pidfd | pidfd 生命周期;pidfd lifecycle |
| kill_group / pid_alive / SIGTERM / SIGKILL | 信号;Signalling |
| read_rss_kb / read_cpu_ticks / clk_tck | procfs 采样;procfs sampling |
| hostname / uname / get_uid / self_exe / probe_reuseport | 平台探针;Platform probes |
| instance_env_blob / base_env_blob | 环境 blob;Environment blobs |
| exit / eprintln / sleep_ms / close | 运行辅助;Runtime helpers |
pub(all) suberror ProcessError {
Failed(op~ : String, errno~ : Int)
}impl Show for ProcessErrorpub(all) struct SpawnSpec {
bun_path : String
script : String
cwd : String
out_log : String
err_log : String
env_blob : Bytes
} derive(Debug)fn base_env_blob() -> Bytesfn clk_tck() -> Intfn drain_child(pid : Int) -> Unitfn eprintln(text : String) -> Unitfn hostname() -> Stringfn instance_env_blob(app_name : String, instance_id : Int, port : Int) -> Bytesfn pid_alive(pid : Int) -> Boolfn pidfd_alive(fd : Int) -> Boolfn pidfd_exited(fd : Int, pid : Int) -> Boolfn platform_error() -> String?fn probe_reuseport(port : Int) -> Intfn read_cpu_ticks(pid : Int) -> UInt64?fn read_rss_kb(pid : Int) -> Int?Install
Download zipSynchronous process management for MoonBit: spawn with env/cwd/redirection, waitpid and pidfd waits, kill, procfs sampling and platform probes
Dependencies