A REAL usecase of Golang Go Routines! - Golang Concurrency Example

preview_player
Показать описание
Hey guys! In this video, I go through a simple real use-case example of Go routines / Golang concurrency. I talk about the use of Wait Groups, the basics of how a Go routine works, and the use of the Golang context package and why you should use it throughout your Go routines.

I hope this video helps any "new to Golang developers" with some understanding of Go Routines and where you may actually want to use them within your services.

Again, in this example, I use Go Routines within an HTTP endpoint to send a "task" to the background so it does not have to wait for a request to finish. This helps to improve perfect of your Golang HTTP endpoints and is an easy way to speed up your response times!

Рекомендации по теме
Комментарии
Автор

Had been reading a lot about contexts and goroutines but this video made a lightbulb go off in my head. The real world examples really help, thank you for that

nulblaze
Автор

don't even think about quitting youtube.
you have top

daloot
Автор

nice, I actually implemented something similar for something I'm building. Great video.

PhanorColl
Автор

I'm a TS dev atm and gonna start learning go pretty soon, could you do a vid about contexts and why they need to be passed everywhere plz :)

joeyywill
Автор

great video!

Only critique I'd make is a pop filter is your friend

Nonsense
Автор

I was just yesterday learning about goroutines and trying to think about use cases. Thanks a bunch, man!

BTW, what color theme are you using?

JaderRubini
Автор

Hi man big up a video on go1.22 with crud and concurrency approach ?

morkhoudia
Автор

Would you still want to update the view count if the request never completes? My logic being that if the request didn't complete or got timedout/canceled the user never viewed the slug.

JamesRhoat
Автор

If incrementing the view count fails you will end up with an inconsistency, the request that should have failed will be interpreted as succesfull...

cesarclarosns
Автор

Can you please provide your git and dotfiles?

yakomisar
join shbcf.ru