36 lines
523 B
Text
36 lines
523 B
Text
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
|
|
}
|