Writing an Interval-based Worker Pool using Generics in Go

Adam Presley
4 min readJun 14, 2023
Photo by Yk K on Unsplash

I recently needed the ability to pull data from a database at a specific interval and process that data. Not only that, but I also wanted to spread the processing to different goroutines (workers) in case the other goroutines were busy, much like a worker pool. This article will describe the code I wrote to achieve this task.

The Basics

--

--

Adam Presley

Just a guy who loves his wife, kids, and writing software.