synplexum/examples/counter.l1

37 lines
523 B
Text
Raw Normal View History

2026-03-02 15:46:50 +00:00
actor counter {
state {
count: u64 = 0
}
window count_view : (count)
readers(display)
on Increment(amount: u64) {
count = count + amount
}
}
leaf ticker {
process {
forward(counter, Increment(1))
}
}
leaf display {
reads counter.count_view
process {
read(counter.count_view.count)
}
}
pipeline main {
ticker -> counter -> display
}
core main {
actors: [counter]
leaves: [ticker, display]
pipelines: [main]
steps: 5
}