✓
Passing This code compiles and runs correctly.
Code
// MIRROR for `std/supervisor:supervised`: the supervised retry fold sits on
// a branch arm inside an imported module — `app/lib` owns the ring, the
// supervised child `attempt`, and the `push` tor that supervises it; the
// entry composes by qualified name. The fold emits re-entry units and this
// is the test that can see whether they qualify through the module's
// import-derived name — the entry file collapses file-name and module-name
// into one, so the 320_110 control cannot tell a correct qualifier from a
// lucky one.
import app/lib
import std/io
app/lib:seed()
| ok |> app/lib:push(x: 10)
| ok |> std/io:print.ln("ERROR: enqueued into full ring")
| full |> std/io:print.ln("mod gave up")
| full |> std/io:print.ln("ERROR: seed")
Supporting Files
import std/rings
import std/supervisor
import std/io
std/rings:new(feed, capacity: 2) { value: u64 }
pub tor attempt { x: u64 }
| ok
| full
attempt = std/rings:enqueue(feed, v: x)
| ok => ok
| full => full
pub tor push { x: u64 }
| ok
| full
push = attempt(x)
| ok => ok
| full |> std/supervisor:supervised
| retry t when t < 2 |> attempt(x: x + 1)
| exhausted => full
pub tor seed {}
| ok
| full
seed = std/rings:enqueue(feed, v: 1)
| ok |> std/rings:enqueue(feed, v: 2)
| ok => ok
| full => full
| full => full
Actual
mod gave up
Expected output
mod gave up
Flows
flow ~seed click a branch to expand · @labels scroll to their anchor
seed
Test Configuration
MUST_RUN