dreamstack/examples/streaming-clock.ds
enzotar 8775860fdd feat: 4-app signal composition demo with explicit outputs
Add 3 new streaming apps with explicit output declarations:
- streaming-clock.ds: output hours, minutes, seconds (tick private)
- streaming-stats.ds: output total, average, max (sum private)
- streaming-mood.ds: output mood, energy, color (clicks private)

Add compose-dashboard.ds that receives all 4 streams via unique
relay channels (/stream/default, /stream/clock, /stream/stats,
/stream/mood) into a single dashboard view.

Each app demonstrates selective signal registration — only declared
outputs are streamed, internal state remains private.
2026-02-26 09:04:22 -08:00

25 lines
564 B
Text

-- DreamStack Streaming Clock
-- Streams time signals every second.
-- Only hours, minutes, seconds are exposed (tick is internal).
--
-- Run with:
-- dreamstack stream examples/streaming-clock.ds --port 3002
let tick = 0
let seconds = tick % 60
let minutes = (tick / 60) % 60
let hours = (tick / 3600) % 24
stream clock on "ws://localhost:9100/peer/clock" {
mode: signal,
output: hours, minutes, seconds
}
every 1000 -> tick += 1
view clock =
column [
text "🕐 Streaming Clock"
text "{hours}:{minutes}:{seconds}"
text "tick: {tick}"
]