tcmts.cli.checkers

Types

CheckRequest type
Rendered modules to analyze, as `Codebase.rehash` writes them: what a checker process is asked. Everything it needs is in it (the files are on disk, in `cacheDir`), so a checker needs no codebase of its own.
CheckResult type
What analyzing a CheckRequest found: its definitions, as derived there, and the problems (formatted).
CheckerPool type
Checker processes, each answering one CheckRequest at a time.

Server

checkerCount () => number
How many checker processes a sync checks received definitions with at once: `TCM_CHECKERS`, or half the machine's cores, up to 4 (one inside a slot another holds, inSuiteSlot: a suite's). One means none: it checks them itself.
checkerPool () => CheckerPool | undefined
This process's checker processes, started as they're first needed (and kept, for the next batch or push): none where it isn't the CLI (nothing to start more of), or where checkerCount is one. Each check takes a slot of the machine's (withSlot) while it runs, shared with every tcm's work.
runCheck (req: CheckRequest) => CheckResult
Analyze a CheckRequest: what a checker process does with each, and its compilation let go after.
serveChecks () => Promise<void>
A checker process (`tcm internal-check`, not a command anyone types): a CheckRequest per line on stdin, and for each, in turn, a line on stdout: `\0check ` and its CheckResult (or `{"error": …}`) as JSON.
startCheckers (command: string[], size: number) => CheckerPool
`size` checker processes running `command internal-check`. While one works on a request it keeps this process running; idle, it doesn't (and goes when this process does). One that ends fails what it was asked, and is started again for the next.

Shared

TCM_COMMAND typeof TCM_COMMAND
The command that runs this tcm, set by the CLI (`runCli`) as it starts: checker processes are more of it.