Realtime (Phlo Realtime)
Phlo Realtime pushes the same update to every open tab.
Read the docs →.phlo
// vote, then push the new results to every open tab.
route both POST poll vote $id {
poll::change('id=?', $id, votes: $o->votes + 1)
cast(wsTarget: 'all', outer: ['#results' => $this->results])
if (%req->async) return apply(outer: ['#results' => $this->results])
}
// app.ws.phlo: the daemon calls these hooks on connect and close
function wsConnect($host, $token, $socket){ presence::create(socket: $socket) }
3 onlineOpen this page in a second tab, then vote: both update at once.
Phlo
55%
Svelte
23%
React
14%
Vue
9%
