Last active
July 18, 2018 17:16
-
-
Save dmora/b585747e2f534bba7384b7e07f38fbb3 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 *Manager) Collect(proc ResultProcessorFunc) { | |
for result := range m.results { | |
outcome := proc(result) | |
fmt.Printf("Job with id: [%d] completed, outcome: %s", result.job.id, outcome) | |
} | |
m.done <- true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment