Skip to main content

Module process

Module process 

Source
Expand description

Process-management helpers that pair with [crate::lockfile]’s owner lookups: given a pid (e.g. from [crate::lockfile::owners] / [crate::lockfile::owners_in_tree]), ask the OS to terminate it — plus the repo-wide no_window spawn hygiene.

Structs§

ServerReady
The one-line stdout readiness handshake every persistent server the daemon spawns (db / api / mcp / viewer / laboratory host) emits the moment it is serving: {"type":"ready","address":...}. The daemon — which holds the child’s stdout pipe for its whole life (the children are OS-leashed to it) — reads lines until this parses, caches the address, and keeps draining. address is the server’s client connect coordinate (http://… for api/mcp, postgresql://… for db) or None for servers with no listener (viewer, laboratory host — they dial out; the line is pure readiness).

Functions§

no_window
Windows CREATE_NO_WINDOW: spawn the child without a console window. Our services are windowless (daemon, laboratory host, db supervisor, the viewer shell), so every console-subsystem child they spawn — podman, postgres, plugins, tools, runners, the cli re-execing itself — otherwise allocates and FLASHES its own console at the user. Applied at every runtime spawn site in the repository; no-op off Windows.
parse_ready
Parse one stdout line as the readiness handshake. None for anything else (servers may print other lines; the reader skips them).
print_ready
Print the readiness line to stdout and flush. UNCONDITIONAL by contract — never behind a suppress-output flag: the spawner blocks on this line, and the daemon’s persistent drain makes any later stray writes harmless.