Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Start starts the worker pool process
- func (m *Pool) Start(resources []interface{}, procFunc ProcessorFunc, resFunc ResultProcessorFunc) {
- log.DEBUG.Print("worker pool starting")
- startTime := time.Now()
- go m.allocate(resources)
- m.done = make(chan bool)
- go m.collect(resFunc)
- go m.workerPool(procFunc)
- <-m.done
- endTime := time.Now()
- diff := endTime.Sub(startTime)
- log.DEBUG.Printf("total time taken: [%f] seconds", diff.Seconds())
- }
Add Comment
Please, Sign In to add comment