I'm using Ruby on Rails to build a real-time game web app. When a player
taps "Play Now", I want to match them up with another player that is
looking for a game (match-making). With my basic understanding of RoR,
one immediate way I think I can do this is create a DB table that
contains the players that are looking for a game. When a new player
wants to play, I can just query the DB for the two most recent players
and connect them together, and remove them from the DB. But this doesn't
sound optimal since the list of players can potentially be large and the
query could be slow.

Are there more efficient ways to implement this kind of match-making in
RoR? Or a more efficient way to implement a persistent queue?

Other ideas?

Thanks in advance for your wisdom!

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/3e5c5e0d6eaa0f36f1a451e0c1481397%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to