Go Concurrency Patterns

One of Golangs strengths is its composibility. This strength is only useful if you know how to make those composable parts. That is where patterns are useful.

Golang is concurrent, which is not necessarily parallel. However, to make things concurrent you have to break thing into automatic steps. If you are careful in how two step share information then you can easily turn concurrent design into parallel design. Go channels make this communication stupid simple.

In this post I am going to share what I think are the basis of most other concurrency patterns: The Generator, The Worker, and The Consumer.

Golang Steam File

Go (golang) is a highly concurrent language. But more then that it is a simple language built using modular components and string them together in useful ways. This modularity has lead me to play around a bit and one of things that I found was a easy way to stream a file.