Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sunspirit99 committed Dec 26, 2022
1 parent d33a944 commit 70951f3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions workerpool/workerpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ func (wm *WorkerPool) AssignTask(tasks ...*Task) {
wm.Wg.Wait()
}

// start WorkerPool
// start WorkerPool with n workers
func (wm *WorkerPool) Start() {
for i := range wm.Workers {
go wm.Workers[i].run(wm.Pool, wm.Wg)
}

fmt.Printf("%d workers are ready !\n", len(wm.Workers))
}

func (w *Worker) run(taskQueue chan *Task, wg *sync.WaitGroup) {
Expand Down

0 comments on commit 70951f3

Please sign in to comment.