Pump

~import orisha/pump

Orisha's pump — the contract.

lib/pump.k · 21 tors

Orisha's pump — the contract. · 26 more lines
Orisha's pump — the contract. What a pump is: the thing that owns the readiness loop and hands the flow one exchange at a time. Every declaration is here; the loop bodies, one per platform, are in the companion `pump.kz`. This file has no host language in it, so it has no `~` in it either. TLS helpers live in koru/openssl; imported from orisha/index.k so emission orders koru_openssl before this submodule in the merged module. RUN — context-aware surface; DRIVE — the standalone loop it lowers to `run` is a transform in the companion `pump.kz`: with no `std/pump` open above the call site it emits `drive` — the accept loop, one variant per platform — and inside an open pump it emits `init` plus the join units that capture it. Either way `! arrived` fires once per request and RESUMES, and `! frame` fires once per complete websocket message after a 101 answer flips the connection; `| stopped` and `| failed` are the two ways it ends. `*Exchange` is a host type the companion declares — a contract may name one, it just may not define one. `pass_begin`/`pass_commit` are the dispatch-pass bracket: begin fires once before a pass drains its completions, commit once after — the window every `arrived` of that pass runs in. A claimant that batches its data work (one transaction per pass, not per request) implements batch-begin / batch-commit; pumps honoring the arms call them unconditionally and the default no-ops make the bracket free when unused.

run

comptimetransformclaims_descendants lib/pump.k:41

__retire

lib/pump.k:57

fill

retain lib/pump.k:113

ws-send-fd

lib/pump.k:164

ws-closed

abstractretain lib/pump.k:181

ws-frame

abstractretain lib/pump.k:196

batch-begin

abstractretain lib/pump.k:221

batch-commit

abstractretain lib/pump.k:223