Below you will find pages that utilize the taxonomy term “Go Concurrency: Patterns and Idioms”
Go Concurrency 2.5 - Patterns and Idioms | Fan Out Fan In
So far we have discussed how Pipelines pattern can be leveraged to re-use and compose programs together. But what if I told you that we can leverage performance/speed gains by utilising Pipelines to process streams in parallel? Isn’t that the general idea of concurrency? Let’s do a simple program to find prime numbers and then let’s compare it with its Fan Out Fan In equivalent.
I am going to use testing package in this case to benchmark performance and compare them later.
Published on Mon, February 5, 2024
Go Concurrency 2.4 - Patterns and Idioms | Generators
Generator pattern is an effective way to handle conversion of concrete slice/array types to a data stream in the for of channels. These become absolutely handy when you start working with sync primitives in Go. Using this pattern also helps in predictability and readability across application.
Published on Tue, October 24, 2023
Go Concurrency 2.3 - Patterns and Idioms | Pipelines
Pipeline design pattern is not limited to concurrency and is something that every programmer has followed or implemented, even if unknowingly. A pipeline could contain one or more stages, ideally limiting single responsibility to each stage. This allows different stages to be rearranged, to be added or removed.
Published on Sun, October 1, 2023
Go Concurrency 2.1 - Patterns and Idioms | Fundamentals
In this post we talk about some of the common patterns used in Go community that are going to prove handy when working with goroutines. The topics covered are Confinement, Infinite for loop with exit case, Loop with default case and Loop with Range and the default case pattern.
Published on Tue, August 8, 2023