News for hackers. Stuff that matters.
Re:Httpx: A Ruby HTTP library by pmontra on Wednesday October 30, 2019 @05:30AM (#21395888)
Do you mean, that vs something like this?

    responses = HTTPX.get("/page1").
                      get("/page2").
                      start
My guess is that the focus of HTTPX being parallel requests, the author choose an API that explicitly groups them together. The documentation is pretty sparse, I wonder if we can pass an array of URLs to get().
Re:Httpx: A Ruby HTTP library by fouc on Wednesday October 30, 2019 @06:53AM (#21396296)
yes, ruby has a splat * operator that will basically expand an array into a set of arguments.

    array = ["https://news.ycombinator.com/news", "https://news.ycombinator.com/news?p=2", "https://news.ycombinator.com/news?p=3"]

    page1, page2, page3 = HTTPX.get(*array)
Re:Httpx: A Ruby HTTP library by stormbrew on Wednesday October 30, 2019 @02:38PM (#21401003)
Note you can also splat the return as well:

    *pages = HTTPX.get(*urls)
Re:Httpx: A Ruby HTTP library by lloeki on Wednesday October 30, 2019 @06:53AM (#21396300)
splat?

   urls = ['https://example.com/foo', 'https://example.com/bar']
   HTTPX.get(*urls)