Hello, I'm making this game where I'm trying to "pair people". So I have this database where I add people when they want to join a game. And when two people want to join a game, I redirect them to the game.
But I wanted to make this in ajax (which I'm a new to), so that it continually looks at the database if a new person has joined. I thought using this would be a good method:
new Ajax.PeriodicalUpdater('products', '/some_url',
{
method: 'get',
insertion: Insertion.Top,
frequency: 1,
decay: 2
});
But then he reminded me that it'd open and close the database all in vain very many times. Is there a better solution?