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

Sdílet
Vložit
  • čas přidán 2. 05. 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
  • Věda a technologie

Komentáře • 14

  • @eldr-io
    @eldr-io  Před 26 dny +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

  • @AnandKumar-dc2bf
    @AnandKumar-dc2bf Před 21 dnem +2

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

  • @frankjansson7563
    @frankjansson7563 Před 12 dny

    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 :)

  • @dejanduh2645
    @dejanduh2645 Před 26 dny +1

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

  • @veronez9846
    @veronez9846 Před 16 dny

    one of the bests videos about concurrency.

  • @baronbeans5001
    @baronbeans5001 Před 26 dny +3

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

  • @manishbadgotra
    @manishbadgotra Před 25 dny +1

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

  • @ninapryadko9306
    @ninapryadko9306 Před 26 dny +1

    Thank you so much, absolutely excellent

  • @georgecrisan9499
    @georgecrisan9499 Před 4 dny

    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 Před 26 dny

    😍😍😍😍