Created
July 19, 2018 22:39
-
-
Save dmora/db1345d906ec1e494e3721cac68f93d0 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
// Collect post processes the channel "Results" and calls the ResultProcessorFunc passed in as reference | |
// for further processing. | |
func (m *Pool) collect(proc ResultProcessorFunc) { | |
log.DEBUG.Print("goRoutine collect starting") | |
for result := range m.results { | |
outcome := proc(result) | |
log.DEBUG.Printf("Job with id: [%d] completed, outcome: %s", result.Job.id, outcome) | |
} | |
log.DEBUG.Print("goRoutine collect done, setting channel done as completed") | |
m.done <- true | |
m.completed = true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment