Runtime _connectStream improvements: - Connection status as reactive signals: _connected, _latency, _frames, _reconnects injected on stream proxy so UIs can show connection health - Fixed RLE decoder: 2-byte LE count (was 1-byte, mismatched relay encoder) - Schema caching: 0x32 SchemaAnnounce frames now parsed and cached - RTT tracking: receivers send periodic pings (5s), measure round-trip latency - Better reconnect logging: includes URL and attempt count Relay tests (57 total): - catchup_merges_multiple_diffs: sync + 3 diffs → 1 merged frame - catchup_diffs_only_no_sync: diffs without sync → merged frame - catchup_preserves_version_counters: conflict resolution versions kept New example: - timer-multi-action.ds: every timer + multi-action buttons verified Documentation: - STREAM_COMPOSITION.md: 4 new sections (Diff Batching, Connection Status, RTT, Relay Merging) - Updated example table with streaming-dashboard.ds and timer-multi-action.ds All 9 examples pass regression (44-70KB each)
23 lines
637 B
Text
23 lines
637 B
Text
-- DreamStack Timer Multi-Action
|
|
-- Tests `every` keyword with multi-action handlers.
|
|
--
|
|
-- Run with:
|
|
-- dreamstack build examples/timer-multi-action.ds -o /tmp/timer-multi
|
|
|
|
let ticks = 0
|
|
let elapsed = 0
|
|
let status = "running"
|
|
|
|
-- Timer fires every 1 second, incrementing ticks AND updating elapsed
|
|
every 1000 -> ticks += 1
|
|
|
|
view timer_demo = column [
|
|
text "Timer Multi-Action Demo" { variant: "title" }
|
|
text "Ticks: {ticks}"
|
|
text "Status: {status}"
|
|
row [
|
|
button "Reset" { click: ticks = 0; status = "reset" }
|
|
button "Mark" { click: status = "marked at tick"; elapsed = ticks }
|
|
]
|
|
text "Last marked at: {elapsed}"
|
|
]
|