N
N
Nurba Nurba2017-04-06 17:16:06
PHP
Nurba Nurba, 2017-04-06 17:16:06

How to update the selection asynchronously for each user?

There is such a task.
The user makes a request according to certain criteria. The base is updated every second (for example).
It is necessary to display the update as it arrives in real-time mode. Without updating the page.
Digging towards memcashed+ajax. But I see no point in storing in the cache what changes every time. Read about long polling. pusher services.
Finally confused.
And how to link a user if they have the same search criteria. This is to avoid producing the same cache entries.
I don't know where to dig. Maybe switch to node.js and sockets.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Timofeev, 2017-04-06
@webinar

Sockets are the right direction, it is possible without node.js
for reading at your leisure:
https://habrahabr.ru/post/209864/

D
Dmitry Belyaev, 2017-04-06
@bingo347

Look in the direction of rethinkdb, this database can notify the application about data changes on any request except for aggregating ones.
But also for communicating with the frontend - websocket

V
Victor, 2017-04-17
@Levhav

At the moment when you write new data to the database. For example, if you have a chat, then at the time of writing a new message to the database. It is also necessary to additionally notify all users who wish to learn about these changes, for example, by sending them information on web sockets.
Here is a php chat demo in which sending messages to subscribers in websockets is implemented.
It works in tandem with the comet server https://github.com/CppComet/comet-server which provides a simple api for delivering messages via websockets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question