antcolony
All repositories: gitoria
1.6 KB
// process.hl → class Process — one child, its lifetime, its events. The// eventloop wiring lives HERE so app code never sees it: the events source is// registered AT this instance, the internal fan-out re-emits `line` and// `exit` at itself, and `on process.line` / `on process.exit` in the app are// ordinary instance-scoped handlers.Number pid = 0Boolean running = falseNumber #srcId = 0start(String cmd) {// THE STRING GOES OVER WHOLE (mission 249). `hl_proc_spawn` branches on// the argument's type and its string branch is the tokenizer server.hl// documents: whitespace RUNS (spaces, tabs, newlines — a command written// across lines is one command) and quote GROUPING. Splitting here on " "// and handing the pieces to the LIST branch is what kept that code// unreached, and put a tab or a newline inside argv[0].return this.launch(cmd)}startArgs(args) {return this.launch(args)}// The one spawn: `spec` is the command STRING or the argv LIST, and which// one it is decides the branch inside `hl_proc_spawn`, never anything here.launch(spec) {let spawned = __native("proc.spawn", spec)pid = spawned.pidrunning = true#srcId = __native("eventloop.register", spawned.events, "__procEvent")return this}on __procEvent(ev) {if (ev.exit != null) {running = false// A FINISHED CHILD RETIRES ITS SOURCE (server.hl: "a program whose// children are done simply ends"). Without this the loop still holds// a source that will never speak again and the program never returns.__native("eventloop.unregister", #srcId)emit exit(ev)return null}emit line(ev)return null}kill() {if (running == false) {return false}return __native("proc.kill", pid)}
Branches
- mainmain branch
Latest commits
- 3a4d0324antcolony#37: a too-long report gets up to 3 fix tries, finished work is never thrown away for lengthmre
- a6af7883tracker: worker box sees calendar.worldapi.org (login to copy)mre
- c613d26btemplates: bridges to external components (login.js for ident's selector) are allowed (creator 2026-09-27)mre
- 9062978ctracker: worker box sees /media/STORAGE/projects/old-tracker read-only (tracker#2 source data)mre
- 7f9660eeState of 2026-09-27, before the move to gitoriamre