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 struct 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 all handling requests concurrently on the same channel. These workers will be crypto workers like in a web authentication app. Their purpose will be to hash plain text strings using bcrypt package and compare a text password against a hash.
Using the worker pool design pattern
Getting ready
Refer to the Getting ready section of the Using channels and the select...