‹ BackHN Continuity

Thread

Go Concurrency Distilled

402 points · 187 comments · chmaynard

  1. SamInTheShell · · focus · HN ↗
    The concurrency and threading in Go just feels like magic compared to every other language. I'm a goroutine addict and I refuse to be rehabilitated.

    Just from observations over the years, I don't think there's any other language quite like this, in terms of how things can end up happening in any thread.

    1. neillyons · · focus · HN ↗
      Elixir concurrency feels like magic with async_stream <a href="https:&#x2F;&#x2F;elixir.hexdocs.pm&#x2F;Task.html#async_stream&#x2F;5-options" rel="nofollow">https:&#x2F;&#x2F;elixir.hexdocs.pm&#x2F;Task.html#async_stream&#x2F;5-options

        [
          &quot;https:&#x2F;&#x2F;httpbin.org&#x2F;delay&#x2F;1&quot;,
          &quot;https:&#x2F;&#x2F;httpbin.org&#x2F;delay&#x2F;2&quot;,
          &quot;https:&#x2F;&#x2F;httpbin.org&#x2F;delay&#x2F;3&quot;
        ]
        |&gt; Task.async_stream(
          &amp;Req.get!&#x2F;1,
          max_concurrency: 3,
          ordered: true,
          timeout: to_timeout(second: 2)
        )
        |&gt; Enum.to_list()
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.