Next.js Discord

Discord Forum

High level approach to creating a matchmaking queue with accept timeout in serverless environment

Unanswered
Chinese perch posted this in #help-forum
Open in Discord
Chinese perchOP
Hello, this is a bit of broad question. I am looking to implement the following:
- A queue has slots available for players to join
- Once the required number of players to play join the queue, they are prompted to accept the match.
- If someone declines or two minutes has elapsed, cancel the match
- Once everyone accepts, start the match.

What would be some high level considerations / approach to a problem like this? It's quite simple in an environment with state and no need to consider concurrency, but I'm not sure where to start with serverless.

Job queues for the long two minute wait?
Realtime communication with clients, something like Pusher?

1 Reply

Chinese perchOP
Still very interested in hearing anyones thoughts on this