This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 10/5/2026.
Pump.run
~import std/pump.runKoru Standard Library: the `run` part of pump — joined via
pump.run.kz · 1 tors
Koru Standard Library: the `run` part of pump — joined via · 19 more lines
Koru Standard Library: the `run` part of pump — joined via
`~part run` in pump.kz; members land in koru_pump.
PUMP.RUN — drive a declared pump until every participant drains.
std/pump:run(main)
! idle |> ...
Enumerates the joined `__pump_<name>_step_<i>` units and emits
`__pump_run_<name>`: while any participant's `live` counts rows, step each
in join order. A pass with zero progress fires `! idle` — armed, the arm
runs in the loop; unarmed, the union wait collects every `wait` unit's
interests and polls once, or breathes 1ms when nothing was declared.
Retirement: a participant may emit `__pump_<name>_retired_<i>` — fired by
the driver exactly once, on the first pass whose `live` answers 0, ahead
of `| drained`. This is where a captured participant's run-terminal arms
(`| stopped`, `| done`) land. It requires `live` — an immortal participant
never retires.
// Koru Standard Library: the `run` part of pump — joined via
// `~part run` in pump.kz; members land in koru_pump.
//
// PUMP.RUN — drive a declared pump until every participant drains.
//
// std/pump:run(main)
// ! idle |> ...
//
// Enumerates the joined `__pump_<name>_step_<i>` units and emits
// `__pump_run_<name>`: while any participant's `live` counts rows, step each
// in join order. A pass with zero progress fires `! idle` — armed, the arm
// runs in the loop; unarmed, the union wait collects every `wait` unit's
// interests and polls once, or breathes 1ms when nothing was declared.
//
// Retirement: a participant may emit `__pump_<name>_retired_<i>` — fired by
// the driver exactly once, on the first pass whose `live` answers 0, ahead
// of `| drained`. This is where a captured participant's run-terminal arms
// (`| stopped`, `| done`) land. It requires `live` — an immortal participant
// never retires.
~[keyword|comptime|transform] pub tor run {
expr: Expression,
invocation: *const Invocation,
item: std/compiler:*const Item,
program: std/compiler:*const Program,
reporter: std/compiler:*ErrorReporter,
allocator: std.mem.Allocator
} -> SiteResult