should be complete with initial read posts code

This commit is contained in:
2025-12-20 15:51:18 -07:00
parent 80bd0e03fd
commit 9e6bf2feda
6 changed files with 176 additions and 38 deletions
+3 -3
View File
@@ -44,15 +44,15 @@ func AmNewPool(parent context.Context, workers, queueSize int) *WorkerPool {
tasks: make(chan Task, queueSize),
}
for i := range workers {
p.wg.Add(1)
go p.worker(i)
p.wg.Go(func() {
p.worker(i)
})
}
return &p
}
// worker is the worker goroutine for a pool.
func (p *WorkerPool) worker(id int) {
defer p.wg.Done()
for {
select {
case <-p.ctx.Done():