diff options
| author | eunhhu <[email protected]> | 2026-10-01 02:36:06 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-01 02:36:06 +0100 |
| commit | a05b9428c9d12ce0ea76f6e4539aa911f42b6eef (patch) | |
| tree | b4fc01b0a90d0ac42e0498461f02a335d079eb13 /docs/design/002-memory-lifetime.md | |
| parent | 2a0f601cbd3ea6af1bb031b29a07d5facb0a4579 (diff) | |
| download | pure-a05b9428c9d12ce0ea76f6e4539aa911f42b6eef.tar.gz pure-a05b9428c9d12ce0ea76f6e4539aa911f42b6eef.zip | |
Run many apps on one host, by turns on workers (017)
pure-serve --apps FILE hosts an app a line: NAME MODULE STORE and its
budgets (memory=, work=, queue=). Each app's routes start with its name
and reach its own module, states, snapshot and queries; a view is shown
on the connection thread from its own app's snapshot, read once a round.
No app has a thread of its own. Its owner is what used to be a thread's
loop, now a turn: its due timers, what its wires delivered, and the
requests waiting for it applied and saved once, its answers handed back.
Workers (--workers N; one for a host of one app, else one a CPU at most)
take apps from a queue in turn; a worker sleeps until the soonest timer.
A turn takes every waiting request when no other app waits, else 256;
it gathers the clients its last save answered only when alone.
An app's queue budget refuses what would wait past it (503 busy) on the
connection thread, before its owner sees it. An app whose module does
not load, whose store does not open, or whose store is another app's
stops alone: the start line says why, and its routes answer 503
stopped. The stop line counts each app's turns, events and refusals.
A host of one app (--module) runs as before, its owner on one worker
named pure-owner: every check passes unchanged. server_apps runs six
apps of which two stop, floods one past its queue while another
answers, refuses a walk past one app's work budget that another runs,
holds an app's store from another process (that app answers 503
store_busy and applies nothing, the others save), and restarts.
Diffstat (limited to 'docs/design/002-memory-lifetime.md')
0 files changed, 0 insertions, 0 deletions
