Monday, 18 December 2017

How to check multiple inequality for data taken with http-request ?

I have program in node.js that send POST request to server and gets a price value every few seconds . I want to track the value for multiple users with each their own limit for price that if passed need to be notified. My question is how can I do that since you can't return from asynchronous function ? ( Or am I approaching this the wrong way?)The way it works now is I call the functionvar cloop = setInterval( function() { getValue(limit); }, 3000); where the limit is the limit user wants but it would be redundant to call it multiple times for each user. getValue is the function with POST request inside it and the limit is checked in the callback function.Thank you

Submitted December 18, 2017 at 10:41AM by afghanmeysi

No comments:

Post a Comment