nustack
Catalogue

Flow

Command-composing atoms. Sub-shapes: Strategy (how children run together) and Control (branching, looping). Flows yield nothing.

Convention: Control names carry the *Do suffix to mark them as Flow (effectful) rather than Query (pure). Bare verb forms (If, Switch, ForEach) are reserved for Queries.

Core only - shapes and ext/ not included.

Strategy

NameSub-shapeSignatureOperatorMeaning
SequentialStrategySequential(*cs)>>run children in order
ParallelStrategyParallel(*cs)|run children concurrently
RaceStrategyRace(*cs)&first to complete wins
GatherStrategyGather(*cs)run concurrently and collect yields
AnyNStrategyAnyN(*cs)concurrent; succeed if any succeeds

Control

Branch

NameSub-shapeSignatureMeaning
IfDoControlIfDo(cond, body, else_body=None)run body if cond is truthy
SwitchDoControlSwitchDo(selector, cases, default=None)multi-way branch on selector value

Loop

NameSub-shapeSignatureMeaning
WhileDoControlWhileDo(cond, body)run body while cond holds
ForeverDoControlForeverDo(body)run body indefinitely
ForEachDoControlForEachDo(items, body, item="item")run body per element; binds element to ctx.attrs[item]
ForRangeDoControlForRangeDo(start, stop, body, step=1, index="i")counted loop over range(start, stop, step)

Timing

NameSub-shapeSignatureMeaning
DelayedDoControlDelayedDo(delay, body)sleep delay seconds then run body (sync: time.sleep, async: asyncio.sleep)

On this page