✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 450_001_node_borrow_spawn_run_evict_drain: `std/node:new`
// relocated into an imported module.
//
// new is a top-level-item transform — it must stay the invocation head of
// its flow (the transform refuses mid-chain placement itself). Mirroring it
// checks that the node's registry, fleet record and drain all resolve when
// the declaration site lives across the module boundary.
import app/lib
app/lib:run()
Supporting Files
import std/io
import std/node
import std/cell
import std/proto
import std/runtime
std/proto(room_state) {
visits: u32
}
pub tor greet { name: string } -> string
greet -> name
std/runtime:register(scope: "cell") {
greet(5)
}
pub tor run {}
// Worldless node, same as 450_001: the harness runs output binaries with
// cwd = repo root, so a world root would litter it.
run = std/node:new(node, scope: "cell", world: "", capacity: 8)
|> std/io:print.ln("node up")
|> std/node(node)
| node f |> std/node:drain(f): n |> std/io:print.ln("drained {{ n:d }} cell(s)")
Actual
node up
drained 0 cell(s)
Expected output
node up
drained 0 cell(s)
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN