In my NodeJS, there is a huge processing task that comprises downloading the audio files from IBM cloud that are around 600MB(8-10 audios each of around 70MB) and then processing those audio files using FFMPEG https://www.npmjs.com/package/ffmpeg. Audio processing takes very huge time for around 5 minutes. This process is asynchronous so my Front-end will be responsive.
How can I handle multiple requests for the same processing of audios but the problem is multiple requests will have different audios to get downloaded and processed, so the race condition might occur while handling multiple requests. By reading other stack overflow answers, I get to know there are approaches like creating child process or worker threads. What will be the appropriate approach to my use-case and how can I make sure race-condition is not met?