Using the worker pool design pattern

The worker pool design pattern is one where you dispatch long-running Goroutines as workers. These workers can process a variety of work either using multiple channels, or by using a stateful request structure that specifies the type, as described in the preceding recipe. This recipe will create stateful workers and demonstrate how to coordinate and spin up multiple workers who are all handling requests concurrently on the same channel. These workers will be crypto workers, as in a web authentication application. Their purpose will be to hash plaintext strings using theĀ bcrypt package and compare a text password against a hash.