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>
915 B
915 B
| id | name | category | kind | tokens | sig | tip | order | ns | member |
|---|---|---|---|---|---|---|---|---|---|
| http-expected | Http.expected | http | namespace-method | Http.expected | Http.expected(handle) -> int | The body length the server announced, or -1. | 18 | Http | expected |
Returns the length of the response body as the server announced it (Content-Length), or -1 while that is not known. For a request given Http.save_to it is known as soon as the headers arrive, and stays -1 for a reply sent without a length (chunked) — draw an indeterminate bar then. For an ordinary in-memory request it is -1 until the reply lands, then the body length.
program Demo {
entry {
let h = Http.open("GET", "https://example.com/big.bin")
Http.save_to(h, "big.bin.part")
Http.send(h)
print(Http.expected(h)) # -1: nothing has arrived yet
}
}