feat(launcher): Process.*, Http.save_to/received/expected, App.window_hide/show
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>
This commit is contained in:
parent
c1db0d71ed
commit
43d5eb5b88
31 changed files with 89274 additions and 86727 deletions
25
docs/language/process/process-free.md
Normal file
25
docs/language/process/process-free.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
id: process-free
|
||||
name: Process.free
|
||||
category: process
|
||||
kind: namespace-method
|
||||
tokens: Process.free
|
||||
sig: Process.free(handle) -> void
|
||||
tip: Let a process handle go.
|
||||
order: 3
|
||||
ns: Process
|
||||
member: free
|
||||
---
|
||||
|
||||
Releases the handle so it can be reused. It does <strong>not</strong> stop a child that is still running — use <a href="process-kill.html"><code>Process.kill</code></a> first for that; such a child keeps running and is reaped by the runtime when it ends, so it never lingers as a zombie. After <code>free</code>, polling the old handle answers <code>255</code>.
|
||||
|
||||
```ludic
|
||||
program Demo {
|
||||
entry {
|
||||
let h = Process.spawn("/bin/sh", ["-c", "exit 0"])
|
||||
var code = Process.poll(h)
|
||||
while code == -1 { code = Process.poll(h) }
|
||||
Process.free(h)
|
||||
}
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue