Tuesday 17 January 2017

Multiple event listeners?

I'm trying to work around a problem to do with rest streaming between the Nest API and a service (SmartThings) that does not support streaming.To get around this, I have built a service on Sails which takes a post request from SmartThings containing the Nest Token, and then triggers an EventSource event listener that sends the data back to SmartThings.I can easily do this through the browser, however this requires the user to keep the window open which isn't suitable since this needs to be running 24/7.The only way I can think to do this is to create Node service whereby users can initiate a call to my site, that starts the process - almost a multi version of this: http://ift.tt/2jW6n5E problem with this is that I cant figure out a way to control this. When the user starts the stream, there is no way for them to manage it or stop it so the listener will run indefinitely.Does anyone know how I can control this? The only thing I can think of is to create a process for every listener, but there would be in excess of 5000 processes...Any suggestions?

Submitted January 17, 2017 at 07:27PM by Evostance

No comments:

Post a Comment