Skip to content

Commit

Permalink
fix: add SetConcurrent annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
kycheng committed Nov 30, 2023
1 parent 8b5a1ee commit 3c7b34f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parallel/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ func (p *ParallelTasks) FailFast() *ParallelTasks {
return p
}

// SetConcurrent set the number of concurrency
func (p *ParallelTasks) SetConcurrent(count int) *ParallelTasks {
p.Options.ConcurrencyCount = count
return p
}

// SetMaxConcurrent set the number of concurrency.
// if count is greater than max, max is used.
func (p *ParallelTasks) SetMaxConcurrent(count int, max int) *ParallelTasks {
if count > max {
count = max
Expand Down

0 comments on commit 3c7b34f

Please sign in to comment.