Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // allocate allocates jobs based on an array of resources to be processed by the worker pool
- func (m *Pool) allocate(jobs []interface{}) {
- defer close(m.jobs)
- log.DEBUG.Printf("Allocating [%d] resources", len(jobs))
- for i, v := range jobs {
- job := Job{id: i, resource: v}
- m.jobs <- job
- }
- log.DEBUG.Print("Done Allocating.")
- }
Add Comment
Please, Sign In to add comment