Created
May 9, 2021 13:56
-
-
Save syafdia/6b93cbf80c311043cc0347573d66eae7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (wp *workerPool) Run() { | |
for i := 0; i < wp.maxWorker; i++ { | |
go func(workerID int) { | |
for task := range wp.queuedTaskC { | |
task() | |
} | |
}(i + 1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment