You are building a real-time data processing system where tasks are dependent on the completion of previous tasks. How would you structure your Promises/async functions to ensure the sequence is maintained?

  • Using async/await
  • Using Promise.then()
  • Using Promise.race()
  • Using setTimeout()
To ensure the sequence of tasks is maintained in a real-time data processing system, you should structure your code using async/await. This allows you to write asynchronous code in a more synchronous style, ensuring that each task awaits the completion of the previous one. The other options are not typically used for sequential task execution.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *