A realtime multiplayer bullshit bingo game with prefilled or custom bingo cards for things like online meetings or apple keynotes.<p>Demo link is in the readme if you want to try it.<p>I always wanted to build something realtime-ish for the web that multiple people can use simultaneously. I was wondering how such systems could work and how hard the realtime part would be.<p>Here I'm using Postges listen/notify to let my rust service know when tables change without having to query these tables all the time. First I was using one listener for every websocket connection. But a listener keeps a postgres connection hostage, so it would cause problems with too many clients holding a WS connection.<p>Next thing I tried was to have just one listener and send updates to the websocket handler via a mpmc channel. But the channel receivers remove messages from the channel once they read them. Thats unfortunate since changes in a game of bingo are relevant to all players. Meaning that only one random receiver reading the update for a game would be bad for the other players.<p>Now I'm using a channel type from the tokio library called "watch". It contains just one value and receivers can await changes and don't remove the value from a channel on reading it. That allows broadcasting changes to all receivers so that all players getting realtime updates about the game.<p>Next I might look into WebRTC DataChannels to send game updates from client to client without the server in between (mostly).<p>Is someone else working on a similar problem and has repos to recommend?<p>Thanks!
Wow. Well done. Great work. That's what I call overqualification for a work.<p>Besides that, i never have seen a strong stack for a simple game. This is really impressive.<p>Kudos