This sample project provides some concurrency pattern examples in Go using Goroutines. There are three design patterns presented:
- The
waitgroups
pattern. - The
multiple channels
pattern. - The
worker pool
pattern.
To execute the sample example cases you need:
Go
installed on your machine- Change directory to the project's root directory:
cd .../go-concurrency-patterns
- The commands for the different example cases are the following:
go run main.go -mode=waitgroups
go run main.go -mode=channels
go run main.go -mode=workerpool