Skip to content

Instantly share code, notes, and snippets.

@dmora
Last active July 18, 2018 17:16
Show Gist options
  • Save dmora/b585747e2f534bba7384b7e07f38fbb3 to your computer and use it in GitHub Desktop.
Save dmora/b585747e2f534bba7384b7e07f38fbb3 to your computer and use it in GitHub Desktop.
// 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