-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Same as pet shop example, except for pigeon racing
- App will present the next 8 pigeon races in chronological order
- Every minute, a race ends and a new race goes on the end of the list
- Every race has 4 pigeons, each with a current betting odds to win
- Every second, 1 of the odds for 1 pigeon will fluctuate
- Each pigeon in every race has a little graph widget that shows the last 8 betting odds fluctuations
So a single user can hit the /races endpoint, and get a list of upcoming pigeon races
This will update in realtime at least once a second as odds fluctuate and new races are added
Multiple users can view the page at the same time, and they all get updates in real time
Code to do this realtime update is super minimal
... on hitting /races, it creates a long lived SSE connection, and subscribes to the "races" topic
Every second, the app changes state, and broadcasts a MergeFragments packet to redraw the bits that changed, to all subscribers
Metadata
Metadata
Assignees
Labels
No labels