synplexum/examples/window.l1

38 lines
554 B
Text
Raw Permalink Normal View History

2026-03-02 15:46:50 +00:00
actor accumulator {
state {
total: u64 = 0
}
window total_view : (total)
readers(observe)
on Add(value: u64) {
total = total + value
}
}
leaf source {
process {
forward(accumulator, Add(10))
}
}
leaf observe {
reads accumulator.total_view
process {
read(accumulator.total_view.total)
emit(total)
}
}
pipeline main {
source -> accumulator -> observe
}
core main {
actors: [accumulator]
leaves: [source, observe]
pipelines: [main]
steps: 3
}