Skip to main content

When Push Is Not Enough

This example is the Update Cadence panel of TicketOps Live. A simulated dashboard model changes every 50 ms; a refreshTimer applies one coalesced update per tick at the cadence you choose (250 ms / 1 sec / 5 sec); polling is tied to live mode; and the panel counts model events and applied updates separately. The model event never pushes: it counts itself and sets a dirty flag, and the timer decides when the user sees the result.

Run it

cd "LearnWisej-Samples/Real-Time Server Push Course/Module 4/TicketOpsLive"
dotnet run -f net10.0 --urls http://localhost:5304

Then open http://localhost:5304. (Visual Studio: open TicketOpsLive.slnx, press F5.) Keep the tab in front while comparing cadences: browsers throttle timers in background tabs.

What to try

ControlWhat you should see
Live mode ✔the KPI tiles move once per second; EVENTS RECEIVED climbs about 20/s, UPDATES APPLIED 1/s
Cadence → 250 msfour updates per second (about 5 events per update)
Cadence → 5 secone update every five seconds (about 100 events per update) — same information, a fraction of the traffic
Live mode ✘the simulator, the timer and polling stop; the tiles keep the last snapshot

Polling fallback. Add "enableWebSocket": false to Default.json and restart: connectionLabel shows ○ Polling 1000 ms while live mode is on and the browser console logs one Wisej: Poll request. per second. With a WebSocket, polling is not requested (StartPolling is not ignored when a socket is up and would be pure cost).