title: aws lambda execution after callback guaranteed?
body: <p>My node4 lambda function called via API GW makes a sequence of slow API calls.
  In order to not let users wait until everything completes, I'm planning to have my code look like this:</p>
  
  <pre><code>function(event, context, callback) {
    ...
    // Return users API GW call now
    callback(null, data);
    // Do the heavy lifting afterwards.
    longApiCall().then(otherLongApiCalls)
  }
  </code></pre>
  
  <p>But now I read in the <a href="http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html" rel="noreferrer">AWS docs</a>:
  "the callback will wait until the Node.js runtime event loop is empty before freezing the process and returning the results to the caller"</p>
  
  <p>Does that mean the API GW returns the response data before or after the longApiCalls complete?</p>
  
  <p>If after, is there a suggested way for how to "return early" before everything is finished?</p>