Supervision
Four panels count up on separate timers. There is one input field, and each panel has a crash button.
Behavior
The four numbers update on separate timers. Only the number that changed lights up; the highlight marks elements the redraw touched. When one panel's number changes, the other panels and the frame around them are not redrawn.
Pressing crash stops that panel's actor with an error. The supervisor detects this, recreates the panel from its initial state, and increments the restart count. The text in the input field, the other three panels, and their timers are unaffected.
The supervisor
When a panel's actor stops, the supervisor receives down: and recreates the panel.
Wall >> start = ( me monitor: panel. self ).
Wall >> down: d = self with: {
panels: panels copyWith: (me spawn: (Panel label: d actor name)).
restarts: restarts + 1 }.
The stop arrives as a message, and recovery is an ordinary handler.
Why the other panels are not redrawn
The parent actor holds references to its child actors. The references do not change, so redrawing the parent does not redraw the children. This is not an optimization the programmer specifies; it follows from reference identity.
The panels are cloned from a sample element in the designer's HTML.