M
M
Max Khartanovych2014-03-21 15:37:18
PHP
Max Khartanovych, 2014-03-21 15:37:18

How to create real-time web applications?

Good afternoon. Interested in how to create (in general terms) real-time web applications.
Interested in technology, approach.
If, for example, using node.js, sockets - for the purpose of the chat, it's clear, but how to add events when the user is online \ offline, how to combine \ implement it? Two sockets open, or all in one? What if there are many such real-time events?
PS So far, the transition and development of such applications is difficult.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Push Pull, 2014-03-21
@maxkh

I can't give you a specific solution, but something.
Real-time Web Application with Socket.IO, Node.js, ...
together with autobahn.ws/js
socket 1, why more.
All of course depends on the direction of the application. so I can't give specific advice.
client went offline? save data locally, since there are already various storage methods. got a connection? restore connections, and all that is needed (subscriptions, tokens)
send a portion of data to the server.
everything seems to be not difficult.
"What if there are many such real-time events?" - and there are not enough of them. nothing. with proper architecture and scalability, it is possible to achieve processing of very many events

S
Sergey, 2014-03-21
Protko @Fesor

1. For each client, a separate socket is created (that is, for n clients on the server, we have n sockets open and 1, the server accepting new connections), which can be stored in a common heap.
2. events are available to you when the client disconnects, etc. Once this has happened, you can set user statuses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question