Skip to content

Commit

Permalink
Sarthak | WorkerGroup now supports Close method
Browse files Browse the repository at this point in the history
  • Loading branch information
SarthakMakhija committed Aug 18, 2023
1 parent fdfc528 commit faa79db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions workers/worker_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ func (group *WorkerGroup) Run() chan report.LoadGenerationResponse {
return loadGenerationResponseChannel
}

func (group *WorkerGroup) Close() {
for count := 1; count <= int(group.options.concurrency); count++ {
group.stopChannel <- struct{}{}
}
}

// TODO: close the connection if response reader is nil
func (group *WorkerGroup) runWorkers(
loadGenerationResponseChannel chan report.LoadGenerationResponse,
Expand Down

0 comments on commit faa79db

Please sign in to comment.