Practical Concurrency in Go - GoRoutines, Mutexes, Channels and more

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ค. 2024
  • #golang #coding #concurrency #threads #tutorial #programming
    In this video I give some examples of writing concurrent programs in Go, using an example of writing a simple Currency Exchange that fetches currency exchange rates.
    We start by running it with no concurrency, then we implement goroutines fetching in parallel and finally we create a worker pool of threads and channels to enqueue work and dequeue results coming back.
    Hope you enjoy it!
    This video's tutorial repo: github.com/sigrdrifa/go-concu...
    The Currency API: github.com/fawazahmed0/exchan...
    My NVIM config: github.com/sigrdrifa/nvim
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 14

  • @eldr-io
    @eldr-io  24 วันที่ผ่านมา +11

    Hey guys!
    The repo with the source code for this video is here: github.com/sigrdrifa/go-concurrency
    And my NVIM config is here: github.com/sigrdrifa/nvim

    • @rea_kr
      @rea_kr 24 วันที่ผ่านมา

      누나. 예뻐요.

    • @daveragos
      @daveragos 21 วันที่ผ่านมา +1

      pin it

  • @AnandKumar-dc2bf
    @AnandKumar-dc2bf 19 วันที่ผ่านมา +2

    Thanks for ur videos pls make more and more golang videos please.....

  • @frankjansson7563
    @frankjansson7563 9 วันที่ผ่านมา

    I've been wanting to get started with Go these videos are really enjoyable. I enjoy your Non Go videos to. Keep spreading the joy of coding :)

  • @veronez9846
    @veronez9846 14 วันที่ผ่านมา

    one of the bests videos about concurrency.

  • @dejanduh2645
    @dejanduh2645 24 วันที่ผ่านมา +1

    This is the best practical example of concurrency in go I have ever seen. Great job, keep up 👍

  • @baronbeans5001
    @baronbeans5001 24 วันที่ผ่านมา +3

    This was so helpful. Any chance you can do a video on context in go?

  • @manishbadgotra
    @manishbadgotra 23 วันที่ผ่านมา +1

    You really are a Good teacher 💯
    btw Love from India ❤

  • @ninapryadko9306
    @ninapryadko9306 23 วันที่ผ่านมา +1

    Thank you so much, absolutely excellent

  • @georgecrisan9499
    @georgecrisan9499 2 วันที่ผ่านมา

    the example at 10:30 cannot be correct, the error is caused by the fact that there is no Currency item in the currencies map with key 'usd' at the time the go routine outside of the waiting group is running. If you add a 'usd' currency in the code above the error is gone and it prints the rates when it has the record whenever the thread has a chance to run.
    Also at 22:40 you say let's close the resultChan but the code below has close(currencyChan).
    The question is why closing only one? why not both or why any at all?

  • @glepnir522
    @glepnir522 23 วันที่ผ่านมา

    😍😍😍😍