This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0c25ad
commit 8d517eb
Showing
4 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
package workgroup | ||
|
||
// Do starts n concurrent workers (or GOMAXPROCS workers if n < 1) | ||
// that execute each function. | ||
// Do starts each function in its own goroutine. | ||
// Errors returned by a function do not halt execution, | ||
// but are joined into a multierror return value. | ||
// If a function panics during execution, | ||
// the panic will be caught and rethrown in the parent Goroutine. | ||
func Do(n int, fns ...func() error) error { | ||
return DoEach(n, fns, func(in func() error) error { | ||
// a panic will be caught and rethrown in the parent Goroutine. | ||
func Do(fns ...func() error) error { | ||
return DoEach(len(fns), fns, func(in func() error) error { | ||
return in() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters