https://github.com/pdube/nike
Simple parallel job runner
https://github.com/pdube/nike
golang parallel
Last synced: about 2 months ago
JSON representation
Simple parallel job runner
- Host: GitHub
- URL: https://github.com/pdube/nike
- Owner: pdube
- License: mit
- Created: 2018-07-11T19:37:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-09T15:25:58.000Z (over 6 years ago)
- Last Synced: 2024-06-20T12:43:32.773Z (over 1 year ago)
- Topics: golang, parallel
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nike
`nike` is a simple library to run functions in parallel and return the accumulated errors, if any. It will create as many workers as there are CPUs at runtime. It is named after the ancient greek goddess of victory [Nike](https://en.wikipedia.org/wiki/Nike_(mythology))
## Usage example
```golang
package main
import "github.com/pdube/nike"
func main() {
fns := []func() error {
func() error {
//do something here
time.Sleep(time.Millisecond * 500)
return fmt.Errorf("uninmplemented yet #1")
},
func() error {
//do something here
return fmt.Errorf("uninmplemented yet #2")
},
}
errs := nike.JustDoIt(fns)
if len(errs) > 0 {
for i := range errs {
fmt.Println(errs[i])
}
}
}
```