Practical Concurrency in Go - GoRoutines, Mutexes, Channels and more
3,582
Publicado 2024-05-03
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-concurrency
The Currency API: github.com/fawazahmed0/exchange-api?tab=readme-ov-…
My NVIM config: github.com/sigrdrifa/nvim
Todos los comentarios (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
-
Thanks for ur videos pls make more and more golang videos please.....
-
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 :)
-
one of the bests videos about concurrency.
-
This is the best practical example of concurrency in go I have ever seen. Great job, keep up 👍
-
This was so helpful. Any chance you can do a video on context in go?
-
You really are a Good teacher 💯 btw Love from India ❤
-
Thank you so much, absolutely excellent
-
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?
-
😍😍😍😍