V
V
Vyacheslav Belyaev2016-08-31 05:54:49
Notifications
Vyacheslav Belyaev, 2016-08-31 05:54:49

How to implement notification logic in node.js?

What is the best way to notify the client using node.js and socket.io?
1 - Notify the client directly via node.js and socket.io
Minus: If the client is not available for notification, then he will skip it
Plus: The upload speed is fast
2 - Write the text of the notification to the database via php, and through node.js in a loop to do requests to the database and issue to the client
Minus: Return speed - a small delay Plus: The client will
receive a notification anyway Client1 invites client2 to chat. Client1 gets a window with a wait, and client2 gets a confirmation/denial window in the chat. If client client2
refreshes the page at the time the window is issued or after, the window must remain until timed out or client2 makes a choice. Also, if Client1 refreshed the page or clicked to cancel the wait, then client2 hides the window
. I would like to do it through the second option. Something similar was done on comet-server.ru

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Zelensky, 2016-08-31
@TroL929

Confused or not?)

Minus: The client will receive a notification in any case
Plus: Upload speed - a small delay
Store alert in memcached or redis, no php needed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question