Skip to content

Commit 77a5833

Browse files
committed
Add explanation of OperatorConsole and reactor hierarchy.
1 parent b0a073d commit 77a5833

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

04-conservative.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ The fix: California's node sends **null messages** periodically. A null message
5252
In the grid context, a null message with value `0` can be used as "no change in dispatch." It is a heartbeat that lets the remote manager advance logical time even during quiet periods.
5353
We create a `GridServer` that wraps the `OperatorConsole` and sends null messages periodically when the console has nothing to say:
5454

55+
Here, we use LF's [**reactor hierarchy**](https://www.lf-lang.org/docs/writing-reactors/composing-reactors/#hierarchy): `GridServer` contains an instance of `OperatorConsole` with `console = new OperatorConsole()`.
56+
The contained `OperatorConsole` is responsible only for generating real operator commands, while the enclosing `GridServer` combines those commands with a heartbeat timer to forward either a real command or a null message.
57+
5558
```lf
5659
reactor GridServer(null_message_period: time = 1 s) {
5760
input balance_in: int // balance feedback from local GridManager

0 commit comments

Comments
 (0)