As a learning exercise, I am making a simple Ruby command-line application that logs into a handful of websites that have a public API (Reddit, Twitter, etc), checks if I have new messages, and reads them out to me.
It works well... but incredibly slowly, because it waits for each login-getcookies-requestmessages-getmessages cycle to complete beyond moving onto the next one. I would really love to have it work asynchronously, so that I can fire off multiple requests simultaneously, deal with whichever data comes back first, then whichever data comes back second, etc.
I've Googled this problem and looked at other StackOverflow threads, but I'm confused by the different options available, and most solutions seem to be assuming that my program is part of a larger Rails app, which it isn't. So I thought I'd ask: what is the simplest, smartest, most efficient way to do what I'm talking about? I don't need to be guided through it, I'd just like some input on my situation from people who know better than I do, and suggestions as to what I should research to solve this problem.
I'd also be willing to write this in JavaScript to run on Node if that'd be more appropriate.