I currently have some code where I retrieve data from a bunch of URLs. At the moment, I'm doing this sequentially. In order to speed it up, I want to do this concurrently.
To implement this, I'm using the concurrent-ruby
gem. Since I have a lot of files which I'm downloading, I want to limit the number of threads. Also, I don't the return value from each thread, since I'm downloading straight into the destination directory.
My question is for this use case, is a thread pool better than using Promises?
It seems that Promises lie at a higher level of abstraction but are useful when one needs the return value of each concurrent operation. Would a thread pool e.g. Concurrent::ThreadPoolExecutior
thus be more suitable?