Guest User

Untitled

a guest
Jul 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // allocate allocates jobs based on an array of resources to be processed by the worker pool
  2. func (m *Pool) allocate(jobs []interface{}) {
  3. defer close(m.jobs)
  4. log.DEBUG.Printf("Allocating [%d] resources", len(jobs))
  5. for i, v := range jobs {
  6. job := Job{id: i, resource: v}
  7. m.jobs <- job
  8. }
  9. log.DEBUG.Print("Done Allocating.")
  10. }
Add Comment
Please, Sign In to add comment