calendar
All repositories: gitoria
2.4 KB
# hl:proc — child processes`run(command, options)` deliberately blocks the calling thread until the child exitsand its output pipes close. It returns `{ exit, lines, stderr }`; `binary = true`returns stdout as `data` (Bytes) instead of `lines`. A nonzero exit status is a result;a command that cannot start, or exceeds `timeout` (seconds), raises an Error.A signal exit is `128 + signal`.**In an event handler, `run()` stalls the whole event loop**, including HTTP routesand timer deliveries. Auto-await does not turn a blocking plugin call into a fibersuspension. This applies to the run form and a `--native` binary: `run` is theblocking twin of `spawn` (ticket #80) and waits on the calling thread.Use `run` for scripts and short synchronous work. For long jobs in a service, use`spawn` and finish the job in `on child.exit`; the timer handler returns afterstarting the child, allowing requests and subsequent timer ticks to run. Keep abusy flag when jobs must not overlap:```hybrielimport { spawn } from 'hl:proc'import { every } from 'hl:time'Boolean busy = falseclock = every(2)on clock.tick() {if (busy) { return null }busy = truechild = spawn('sleep 3')on child.exit(ev) {busy = falseconsole.log('job exited: ' + ev.exit)}on child.Error(e) {busy = falseconsole.log(e.message)}}```A child that cannot start reports Error rather than exit, so release job state inboth handlers. A killed child still reports exit. Subscribe to `child.line` fortext output or `child.data` with `{ binary = true }` for byte chunks. There is noimplicit shell; use `spawnArgs(['sh', '-c', command])` to request one explicitly.`hl:proc` has no JavaScript implementation.Storage returned by `run` and process events is released after the runtimecopies it, including stdout, stderr and allocated error messages. `spawn` releases preparedarguments after fork and owns its iterator as part of the child's lifetime.There is no asynchronous `run` form; `spawn` is the event-based form.After `native/build.sh`, run `python3 plugins/proc/tests/memory.py`. This Linuxregression installs a counting host heap and makes 5,000 calls per command forboth `run` and `spawn`: empty output, small output, 64 KiB output, and exit 7.Each batch must retain zero native blocks, keep its fd count, leave no children,and grow RSS by at most 1 MiB after warmup. It does not depend on GC timing.
Branches
Latest commits
- f9b8f918Merge branch 'calendar-vendor-day61' into mainAtlas
- 66341793|||PR Vendor Hybriel day61Atlas
- 36fc596bMerge branch 'vendor-day59' into mainAtlas
- b37cc1da|||PR Vendor Hybriel day59Atlas
- 05665102Merge branch 'vendor-day56' into mainAtlas
- 687296fb|||PR Vendor Hybriel day56Atlas
- a6166d4eMerge branch 'hl-standard-3' into mainAtlas
- 6d0eb3b0|||PR Calendar day add buttons only when signed in (Kunibert minor)Atlas
- add4b499|||PR Make calendar day actions keyboard accessibleAtlas
- 79e49b4dMerge branch 'hl-standard' into mainAtlas
- e9fec7bb|||PR HL-STANDARD clean-up: typed parameters, plain locals, by-reference cacheAtlas
- eff166a4Re-vendor complete Hybriel plugins and runtime to day44mre
- cef81394Wait for the DST fixture page instead of an unused socketmre
- 42434f47Check lazy-session cookies after login with a stored anonymous fixturemre
- 728e84e3Re-vendor complete Hybriel day41 plugin directoriesmre
- cbd7ff43Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
- 59d1da0acalendar: plain declarations instead of needless let in 9 files (calendar#17): 49 declarations that are never reassigned; reassigned ones and the timer closure's p stay letmre
- f5415cf9calendar: the Style blocks in the language's nested form (calendar#16): rules named after the View's own elements with their children nested, pseudo-classes and @media nested, merged duplicate select rule; same CSS, shots identical in Chrome at 4 sizesmre
- edb7c947calendar: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 56+4 failing → 60 passedmre
- bf8cc0fcStyles move into their components: the shell's styles into main.hl, the events and the editors into the month view's Style block; styles.hl keeps only the theme inherit, the accent and the message line; .gitignore ignores a bin symlink too; tests/styles-shots.mjs for the before/after pixel comparemre