loading...

re: Common Node.js mistakes in Lambda VIEW POST

FULL DISCUSSION
 

Why using a callback instead of an async function would be a mistake? Why wouldn't the callback work or be less efficient?

 

You can use callback instead of async, but probably shouldn't mix the two as it gives off the impression that you can return early before the async function's promise resolves. Which is not the case, the Lambda invocation will finish and return to the caller with a response when the async function's promise resolves at the end.

code of conduct - report abuse