title: Long polling with AWS Lambda
body: <p>I'm creating a monitoring system for an external API on which I need to invoke a function if the response is different from the initial request.</p>
  
  <p>Currently without any long polling around my functions I've got the following: </p>
  
  <pre><code>  let gameAPI = new game(
        [
          "email@email.com",
          "password",
          "secret",
          "secret"
        ]
    );
  
  
    let lastModified;
  
    gameAPI.login().then(() =&gt; {
  
        gameAPI.getProfileStats(process.argv[2], process.argv[3], process.argv[4]).then(stats =&gt; {
            //first run grab this only
            if(lastModified &lt; stats.data.lastModified) {
                //we found new data, stop polling &amp; update mySQL database.
            } else {
                //continue to run every 1 minute...
            }
        });
  
    });
  </code></pre>
  
  <p>Would <strong><em>AWS Lambda</em></strong> be a good solution for this theory? if so, how would I go about doing it since Lambda charges for computer power usage?</p>