Async with Polling

A background model prints to a buffer while the page auto-refreshes until done

What this demonstrates

  • App + HandleRoot — starts model in a goroutine, redirects to /display
  • Auto-refresh — injects <meta http-equiv="Refresh"> while polling is active
  • HandleDisplay — renders template with buffer content + polling state
  • EndAction() — model signals completion, polling stops

Server-side flow

GET /        → reset buffer, start goroutine, redirect /display
GET /display → render template (auto-refresh while polling)
             → model calls EndAction(), refresh stops
Polling state — partial output visible
During polling — partial output
Complete state — all output rendered
After completion — full output

Live Demo (WASM)

Loading WASM...