Skip to content

Commit

Permalink
Update workerpool.go
Browse files Browse the repository at this point in the history
Co-authored-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Alexandre Perrin <alex@kaworu.ch>
  • Loading branch information
kaworu and rolinh committed Feb 7, 2023
1 parent a86d175 commit cabb17a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions workerpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ func New(n int) *WorkerPool {
}

// NewWithContext creates a new pool of workers where at most n workers process submitted
// tasks concurrently. New panics if n ≤ 0. The given context is used as parent
// context for the workerpool and its tasks.
// tasks concurrently. New panics if n ≤ 0. The context is used as the parent context to the context of the task func passed to Submit.
func NewWithContext(ctx context.Context, n int) *WorkerPool {
if n <= 0 {
panic(fmt.Sprintf("workerpool.New: n must be > 0, got %d", n))
Expand Down

0 comments on commit cabb17a

Please sign in to comment.