WorkerPools in Go Tutorial

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 18

  • @Tutorialedge
    @Tutorialedge  3 роки тому +3

    If you are looking to implement these for production-level applications then it's worthwhile having a look at the following articles:
    The acme of foolishness - by Dave Cheney
    dave.cheney.net/2016/12/22/never-start-a-goroutine-without-knowing-how-it-will-stop
    Thread Pooling in Go Programming - by Bill Kennedy
    www.ardanlabs.com/blog/2013/05/thread-pooling-in-go-programming.html
    These were recommended by www.reddit.com/user/Cazineer/ on Reddit 🙏

  • @Tutorialedge
    @Tutorialedge  3 роки тому +3

    Welcome Gophers 👋 This video on constructing Worker Pools in Go has been taken directly from my new course - The Beginner's Guide to Go - tutorialedge.net/courses/go-beginners-guide/
    If you want support learning Go, then feel free to join the TutorialEdge clan and join us on the Discord server where you can gain access to real-time support!

  • @NunoLopes99
    @NunoLopes99 3 роки тому +1

    Very simple and clear explanation! 👏👏👏

  • @vamsikrishnasiddu3525
    @vamsikrishnasiddu3525 3 роки тому +1

    Nice Explanation of worker pool.
    you can range over the results channel to receive the output instead of using for loop

  • @redcokes
    @redcokes 2 роки тому

    Thank you for tutorial!

  • @devinsomnia366
    @devinsomnia366 3 роки тому

    Welcome back \o/

  • @fffsjkfbrutireer
    @fffsjkfbrutireer Рік тому

    Forgot close body after http call, it makes memory leaks

  • @wisdommatthew6775
    @wisdommatthew6775 3 роки тому

    Awesome tutorial 🥰🥰🥰

  • @aqilisayev5529
    @aqilisayev5529 3 роки тому

    Thanks for great explanation!

    • @Tutorialedge
      @Tutorialedge  3 роки тому

      Absolutely! I'm glad you liked it!

  • @vic_shine
    @vic_shine 3 роки тому

    Thanks for the video! But, which thing in a real life project can solve this solution? Please more explain this for full picture 🖼️

  • @RN-er7mz
    @RN-er7mz 3 роки тому

    Thanks for the video

  • @halfi
    @halfi 3 роки тому +3

    You have deadlock here. You write to bufferized chan jobs, which write to the result chan. When both of buffers will be filled, it will cause of the deadlock. You could try just add more than 6 urls and get deadlock. You shouldn't read to the jobs chan and read from the results chan in one thread.

    • @MuhammadIsmail-bi8ld
      @MuhammadIsmail-bi8ld 3 роки тому +2

      After experiencing it my self, the quick workaround it actually wrap lines 49-52 with an anonymous go func()
      So it becomes:
      ```
      go func() {
      for _, url := range urls {
      jobs

  • @kccccccccccccccc0904
    @kccccccccccccccc0904 2 роки тому

    Why did you loop over the results channel like that? Couldn’t you have just ranged over the channel itself?