This repository houses various golang concurrency pattern implementations. If you are new to concurrency in go, the optimal order to review the solutions is outlined below:
- 01 - Goroutines
- 02 - Channels
- 03 - Generators
- 04 - Fan In
- 05 - Restore Sequence
- 06 - Select Timeout
- 07 - Quit Signal
- 08 - Daily Chain
- 09 - Google Search Synchronous
- 10 - Google Search Asynchronous
- 11 - Google Search Async Filtered
- 18 - Worker Pool
Goroutines
- A basic implementation of goroutines, running things asynchronously.Channels
- A communication mechanism between goroutines, sharing memory by communicating.Generators
- Python like generators, a function returns a channel to interact with it.Fan In
- Merging multiple goroutines results into a single channel for processing.Restore Sequence
- Fan in with a twist, allowing order of fanned channel results to be controlled.Select Timeout
- Giving a routine a period of time to finish else doing something else.Quit Signal
- Signally to a goroutine that it is time to stop potentially early.Daisy Chain
- Many goroutines, passing along messages like chinese whispers - confusing!Google Search Synchronous
- A synchronous implementation of basic google searching.Google Search Asynchronous
- Goroutines per search type and filtering in results.Google Search Asynchronous Filtered
- Omitting results that took too long.- ...
Worker Pool
- Fan out work to multiple works to complete in parallel.
More materials to include in the repository, things I personally need to learn more about:
- indepth channels
- go scheduler, runtime and os thread specifics
- daisy chain is confusing!