Summary

We have seen few approaches to develop concurrent structures that can be run in parallel. We have tried to show a few ways to solve the same problem, one without concurrency primitives and one with them. We have seen how different the publish/subscriber example written with a concurrent structure can be compared to the classic one.

We have also seen how to build a concurrent operation using a pipeline and we have parallelize it by using a worker pool, a very common Go pattern to maximize parallelism.

Both examples were simple enough to grasp, while digging as much as possible in to the nature of the Go language instead of in the problem itself.

Get Go Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.