F
F
fug353812016-02-05 17:41:04
PHP
fug35381, 2016-02-05 17:41:04

Teach how to make a queue on the site in real time?

Tell me how to make it so that when a new user enters the site, he (his ip) gets to the end of the queue. Whoever is first has 5 minutes to do something, after which he moves to the end of the queue.
The problem is that each user's browser needs to know who is currently in the queue and where he is, so you will have to make a bunch of requests either to the database or to the list file. How do smart people do this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex Step, 2016-02-05
@kellas

Use web sockets for fast messaging.
The list will be stored in the memory of the socket server script.
Look at examples of how online chats on sockets are done, it's even easier for you.

X
xmoonlight, 2016-02-05
@xmoonlight

A web socket with a single/common (one single) subscription channel, containing information about the queue (user, place in the queue).

A
Anton Izmailov, 2016-02-05
@WapGeaR

Look towards sockets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question