Last active
July 18, 2018 16:38
-
-
Save dmora/ce8c2a62faff99f1cf18015beec3077c 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
// work performs the actual work by calling the processor and passing in the Job as reference obtained | |
// from iterating over the "Jobs" channel | |
func (m *Manager) work(wg *sync.WaitGroup, processor ProcessorFunc) { | |
defer wg.Done() | |
for job := range m.jobs { | |
output := Result{job, processor(job.resource)} | |
m.results <- output | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment