Last active
July 18, 2018 16:38
-
-
Save dmora/0841dbc8cf37f6176d9fc3e6f99f63da 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
// allocate allocates jobs based on an array of resources to be processed by the worker pool | |
func (m *Manager) allocate(jobs []interface{}) { | |
defer close(m.jobs) | |
for i, v := range jobs { | |
job := Job{id: i, resource: v} | |
m.jobs <- job | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment