As a new coder, I often find documentation less than helpful. Or at least, very difficult to parse. Recently I ran into this while reading the docu...
For further actions, you may consider blocking this person and/or reporting abuse
Brian,
Thanks for taking the time to bring clear documentation into the ruby community. For writing complex concurrent code, concurrent-ruby is an excellent library--but for simple concurrency like API calls, it may be overkill. Ruby actually has solid concurrency built into its standard library, via its Thread class.
To make multiple API calls simultaneously with threads, following your example above, you'd do something like this:
Here's the same idea, with less repetition:
Check this blog post from Thoughtbot for more on how threads work. I have no affiliation with Thoughtbot, I just think their blog is a great resource for rubyists of all experience levels.
Thanks for the reply, and for adding another (better!) approach.
I used concurrent-ruby because it was already in my project as a Rails 5 dependency, so when I started my search it seemed like the obvious tool for the job. Now it turns out what I needed was in the standard library all along, go figure.