So I have to run a process that needs to parse each line of a file, find some specific string (by position), make a call to an HTTP api (which will return the transformation needed for that string), replace with the response and then save to an output file, keeping the order of the original file.
I found several options to do this, but thing is my input files would be 10 million + rows. I could do it line by line, but I would like to take leverage of the HTTP api, supporting over 1500 TPS and therefore I could parallelize the HTTP calls.
I was thinking of reading the files in chunks, getting the strings that needs replacement, calling the HTTP with a promise.all or something and then going to next batch. However I wasn't able find a way on doing this.
I went over all solutions suggested here but that doesn't contemplate the parallel line processing.
Any ideas how can this be done by parallelizing the HTTP calls?