Stock Prices - SharedWorker Demo

Connection: Disconnected
Connected Tabs: 0
Active Tabs: 0
Stale Tabs: 0

How it works: This demo uses a SharedWorker to manage a single WebSocket connection shared across all open tabs. Open this page in multiple tabs to see them all sharing the same connection!

Try it: Switch between tabs or minimize the window - the table updates pause when the tab is not visible to save resources.

Client Status: Connected tabs respond to pings. If a tab doesn't respond (e.g., laptop sleep, network issue), it becomes "stale" but stays in memory for auto-reconnection. Stale tabs are excluded from broadcasts and the connected count.

Symbol Price Change % Change Last Update
Connecting to server...