Тёмный

learn the Go concurrency pattern that blew my mind 

Kantan Coding
Подписаться 48 тыс.
Просмотров 6 тыс.
50% 1

Golang, Go Programming concurrency patterns continued
🌟 Hey devs! 🌟
Ready to level up your coding game? Check out this awesome course on Microservices using Go!
🚀 From beginner to pro, learn to build scalable apps with ease. Don't miss out!
Enroll now: 👉 kantan-coding....
#golanguage #Microservices #CodeWithConfidence 🔥🎉
Join the Discord to talk to me and the rest of the community!
/ discord
Book on Concurrency in Go: www.oreilly.co...

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 41   
@michelemendel
@michelemendel 6 месяцев назад
Your videos about concurrency in Go are very good.
@kantancoding
@kantancoding 6 месяцев назад
Thank you! I’m glad that they are helpful 😊
@paracha3
@paracha3 Месяц назад
Your teaching style is very good specially with conceptual diagram before or after coding. That is something not many youtuber do.
@kantancoding
@kantancoding Месяц назад
Thank you! I’m happy it was helpful
@bjugdbjk
@bjugdbjk 6 месяцев назад
I was always confused with orDone, now its clear, Thank you! And appreciate the last piece of explaining the complete code as a snippet,that was helpful.
@kantancoding
@kantancoding 6 месяцев назад
Thanks for watching! I’m glad it was helpful 😊
@naehalmulazim
@naehalmulazim 7 месяцев назад
Congratulations on your course! I've been following you since your clean architecture videos, which were an absolute game changer for my mindset. Definitely going to try and save up time and money for this course. In the meantime thanks for all your splendid free content. I have never never never considered purchasing a course, and especially not in a language Ive been learning almost since when your content started but if you're interested, I feel like I'm not doing enough vanilla stuff at my current company and it's debilitating and I have never actually taken a microservice to production all by myself before, so even more debilitating.
@kantancoding
@kantancoding 7 месяцев назад
Hey! Thank you so much for your support. I’ll still be posting plenty of free content as well so stay tuned😊 P.s. it really means a lot to me that you’ve stuck around for so long. Thank you for telling me. It made my day 🙂
@naehalmulazim
@naehalmulazim 7 месяцев назад
Of course, you're an inspiration, and please, keep it going!@@kantancoding
@mailman2097
@mailman2097 3 месяца назад
best explanations on go concurrency i found on RU-vid
@muffawuffaman
@muffawuffaman 5 месяцев назад
I like this pattern, wish this were a builtin in Go. one thing - wouldn't it be better to use generic types in the signature of orDone so that you're not losing type info by wrapping the channel?
@matthew1106
@matthew1106 6 месяцев назад
This is an interesting concept. Thanks for sharing.
@kantancoding
@kantancoding 6 месяцев назад
My pleasure!
@marchayes5434
@marchayes5434 7 месяцев назад
Why not make use a `context.Context`? It is the same functionality but with better ergonomics and broader support.
@kantancoding
@kantancoding 7 месяцев назад
Yes, you are absolutely correct my friend. Good insight 😉 Basically, this video is to teach the orDone pattern. The context package needs its own entirely separate video (which I am currently making). I did not want to convolute the explanation of the orDone pattern with context package stuff. But! for those that want to jump ahead, this is what the code looks like replacing the done channel with the context package(the pattern does not change): package main import ( "context" "fmt" "sync" ) var wg sync.WaitGroup func main() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() cows := make(chan interface{}, 100) go func() { for { select { case
@dawnrazor
@dawnrazor 4 месяца назад
Hi @kantancoding, great video and that’s a pattern I’ll look to use in my concurrency projects.
@kantancoding
@kantancoding 4 месяца назад
It’s very useful!
@marcialabrahantes3369
@marcialabrahantes3369 3 месяца назад
isn't there another more common pattern (i.e. in other languages) suitable for the "orDone" function ? I'd imagine a decorator pattern will suffice without the extra relay chan
@Dan-rx8wf
@Dan-rx8wf 7 месяцев назад
nested selects made me feel sad :D Sometimes repetitive/verbose code is way cheaper and easier to maintain than smart abstractions.
@kantancoding
@kantancoding 7 месяцев назад
Hmm, there's a discussion about this in the pinned comment where I responded to a similar comment if you're interested. But aside from that, thanks for watching and contributing 😊
@justintie
@justintie Месяц назад
what you said is actually the go way
@coder_one
@coder_one 11 дней назад
Still, the actor model is the best concurrency pattern for any programming language, including Go.
@kantancoding
@kantancoding 11 дней назад
Thanks for watching :) In my experience, there isn’t really a “best” pattern. It really depends on what you’re building so there can be a better choice of a pattern for a specific project but there is no ‘best’ pattern across the board.
@bjugdbjk
@bjugdbjk 7 месяцев назад
Awesome,u r back with a bang !!!
@kantancoding
@kantancoding 7 месяцев назад
Life got a bit busy but I’m back! Stay tuned for more videos 😊
@bjugdbjk
@bjugdbjk 7 месяцев назад
@@kantancoding do more videos on teh topics like performance analysis and a typical tech stack what used mostly in the production or based on your experience, that will really give some insights which really helps budding Go lang devs.
@kantancoding
@kantancoding 7 месяцев назад
Perf analysis sounds fun. Let me see what I can come up with
@stevenodlum4563
@stevenodlum4563 6 месяцев назад
I feel like this pattern should be called untilDone rather than orDone. For example: for val in range untilDone linguistically makes more sense than for val in range orDone Calling it orDone tells me that we're either doing something or we're not doing something. Calling it untilDone tells me that we're doing something UNTIL we're not doing something, essentially doing the thing until the thing is done rather than doing the thing or not doing the thing.
@kantancoding
@kantancoding 6 месяцев назад
I kind of feel like "range until done" implies that we will in fact range. But if the channel is closed we won't range at all. that's why I think "range or done" is used. We'll range if the channel isn't closed or we'll be done. But of course, naming is subjective and is probably the most difficult part of programming 😆
@michelemendel
@michelemendel 6 месяцев назад
The name "orDone" is more aligned with concepts from functional programming, like "maybe".
@kirannhegde
@kirannhegde Месяц назад
Where can i find the code samples?
@kantancoding
@kantancoding Месяц назад
I don’t think I had them for this video unfortunately
@Wickedism
@Wickedism 6 месяцев назад
Why would you need two select statements in the orDone function instead of using an additional case? Is there a language rule for this use case?
@kantancoding
@kantancoding 6 месяцев назад
Hi, I explain this in the video 🙂
@Rakstawr
@Rakstawr 6 месяцев назад
Good work here.
@kantancoding
@kantancoding 6 месяцев назад
Thank you! Cheers!
@HarishKumar-jm5bk
@HarishKumar-jm5bk 7 месяцев назад
Can u please upload that microservice in go in your youtube also
@kantancoding
@kantancoding 7 месяцев назад
🤔 sorry, I cannot. That wouldn’t be fair to the people that have paid for the course.
@a7kerkh
@a7kerkh 6 месяцев назад
Bro stop making every video about concurrency in go
@kantancoding
@kantancoding 6 месяцев назад
Bro, I’m not AI. You can’t give me orders 😂🤣 Anyways, what types of videos do you want to see?
@hvstech9018
@hvstech9018 4 месяца назад
​@@kantancodingPls don't listen to him... we're enjoying it 😎
Далее
Improve Go Concurrency Performance With This Pattern
34:16
Cheese grater HACK
00:22
Просмотров 1,7 млн
Master Golang with Abstraction
13:30
Просмотров 4,3 тыс.
Why I Use Golang In 2024
9:21
Просмотров 321 тыс.
This Is The BEST Way To Structure Your GO Projects
11:08
Concurrency in Go
18:40
Просмотров 617 тыс.
Learn Go Concurrency in 9.5 minutes
9:34
Просмотров 1,7 тыс.
Golang Channels Or Wait Groups? Let Me Explain.
18:32
Master Golang with Polymorphism
18:17
Просмотров 4 тыс.
Avoid golang interviews unless you know these 3 things
6:38
#25 Golang - Concurrency: Fan-out Fan-in Pattern
8:23