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>
1.5 KiB
1.5 KiB
bump: minor type: feat A launcher's runtime — start a program, step aside while it runs, and download large files with a progress bar.
Process.*—Process.spawn(path, args)starts a program directly (no shell) with this process's environment and working directory and returns at once;Process.poll(h)is-1while it runs, then its exit code (128 + signalfor a signal death,137afterProcess.kill);Process.freelets a handle go.posix_spawnon macOS (runtime/native/process.ll);CreateProcessWon Windows (process_win.ll), with each argument quoted by the MSVC rules and no console window. Linked only into a program that usesProcess.*.Http.save_to(h, path)— beforeHttp.send, streams the response body straight into a file (written atpathitself, created on send) instead of memory;Http.textof such a request is empty andHttp.body_lenis the bytes written.Http.received(h)andHttp.expected(h)(theContent-Length, or-1) are live while it is pending. macOS streams through anNSURLSessionwith a delegate built at run time, Windows through the WinHTTP read loop. Freeing a pending request now cancels it and parks its slot until the worker has let go, rather than freeing what the worker is still writing.App.window_hide()/App.window_show()— take the game's window off the screen and bring it back without closing it or its GL / Vulkan surface; the run goes on while it is hidden. No-ops headless and before there is a window.