Listen To Server Changes
a server has certain variables with values which change on a regular basis. These changes don't emit events or anything. My JavaScript Application receives the values through HTTP-
Solution 1:
In a node.js app (server), you could :
- set up a
socket.ioconnection with your client - create an event
EventEmitterA - subscribe to your event emitter
- do a
setIntervalto check your variables - when one of your variables has changed ->
A.emit('variable-name', newValue) - You recieve the event from
Aand send it to your client throughsocket.io
Post a Comment for "Listen To Server Changes"