title: How to poll another server periodically from a node.js server?
body: <p>I have a node.js server <strong>A</strong> with mongodb for database. 
  There is another remote server <strong>B</strong> (doesn't need to be node based) which exposes a HTTP/GET API '/status' and returns either 'FREE' or 'BUSY' as the response. </p>
  
  <p>When a user hits a particular API endpoint in server <strong>A</strong>(say POST /test), I wish to start polling server <strong>B</strong>'s status API every minute, until server <strong>B</strong> returns 'FREE' as the response. The user doesn't need to wait till the server <strong>B</strong> returns a 'FREE' response (polling B is a background job in server A). Once the server <strong>A</strong> gets a 'FREE' response from <strong>B</strong>, it shall send out an email to the user. </p>
  
  <p>How can this be achieved in server <strong>A</strong>, keeping in mind that the number of concurrent users can go large ? </p>