Node.js · Senior · Question 26 of 75

Processing an upload stream, you call an async function for each chunk without awaiting it. What's the risk?

Explanation

Await inside for await, or use bounded concurrency (for example, readable.map(fn, { concurrency: 4 })), so reading slows down when processing does.

Further reading

Problem with a question

Node.js · Senior · question 26

Test yourself

Take the Node.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz