Process.spawn/poll/kill/free - non-blocking child processes with no shell: posix_spawn on macOS (process.ll), CreateProcessW with MSVC-quoted arguments and no console window on Windows (process_win.ll), linked only when a program uses Process.*. Http.save_to streams a response body into a file (NSURLSession with a run-time delegate class on macOS, the WinHTTP read loop on Windows); Http.received / Http.expected report progress while it is pending. Freeing a pending request cancels it and parks the slot until the worker has finished. App.window_hide / App.window_show take the game's window off the screen and back without closing it; the run goes on while hidden. Docs, examples, tests and a changeset. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
23 lines
644 B
Markdown
23 lines
644 B
Markdown
---
|
|
id: process-kill
|
|
name: Process.kill
|
|
category: process
|
|
kind: namespace-method
|
|
tokens: Process.kill
|
|
sig: Process.kill(handle) -> void
|
|
tip: End a running child.
|
|
order: 2
|
|
ns: Process
|
|
member: kill
|
|
---
|
|
|
|
Ends the child at once — <code>SIGKILL</code> on macOS, <code>TerminateProcess</code> on Windows — with no chance for it to save anything. A later <a href="process-poll.html"><code>Process.poll</code></a> answers <code>137</code> once it has gone. Does nothing for a child that has already ended, or a handle that is not one.
|
|
|
|
```ludic
|
|
program Demo {
|
|
entry {
|
|
let h = Process.spawn("/bin/sleep", ["30"])
|
|
Process.kill(h)
|
|
}
|
|
}
|
|
```
|