O'Reilly logo

Go in Action by William Kennedy with Brian Ketelsen and Erik St. Martin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Concurrency patterns

In this chapter

  • Control the lifetime of programs
  • Manage a pool of resources that can be reused
  • Create a pool of goroutines that can process work

In chapter 6 you learned what concurrency is and how channels behave, and reviewed code that showed concurrency in action. In this chapter you’ll extend that knowledge by reviewing more code. We’ll review three packages that implement different concurrency patterns that you can use in your own projects. Each package provides a practical perspective on the use of concurrency and channels and how they can make concurrent programs easier to write and reason about.

7.1. Runner

The purpose of the runner package is to show how channels can be used to monitor the amount ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required