Claudia Api Builder 1.5.1 released

claudia-api-builder 1.5.1 is now on NPM, with a minor internal change that can improve your API performance if you connect to third-party services.

AWS Lambda, by default, keeps running the VM after request processing completes if there are any pending events in the Node.js event loop. (Check out the callbackWaitsForEmptyEventLoop property of the Lambda context object for more information). This means, for example, if you connect to an external HTTP endpoint and it times out, the Node VM might still wait for the external call to complete although you already returned an error to the user. Because Lambda might (and probably will) try to reuse the same VM, the next request might not execute as quickly as you expect, as the VM is still busy. Claudia API Builder turns this off by default now, so Lambda should suspend the Node VM as soon as your processing ends.

If you really want the old behaviour for some reason, turn this flag back on through the request object, such as below:

api.get(... , function (request) {
  request.lambdaContext.callbackWaitsForEmptyEventLoop = true;
  ...
});

Interested in Claudia.js? Get notified when we release a new version.

Low-volume, high value mailing list, no ads or spam.