Skip to content

koind/parallel-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

parallel-exec

Parallel execution of functions on Go.

Installation

Run the following command from you terminal:

go get github.com/koind/parallel-exec

Usage

Package usage example.

package main

import (
	"fmt"
	"errors"
	
	parallel "github.com/koind/parallel-exec"
)

func main() {
    fns := make([]func() error, 0, 3)
    fns = append(fns, func() error {
        fmt.Println("func 1")
        return nil
    }, func() error {
        fmt.Println("func 2")
        return errors.New("Hi this error1")
    }, func() error {
        fmt.Println("func 3")
        return nil
    })
    
    parallel.Execute(fns, 1, 1)
}

Available Methods

The following methods are available:

koind/parallel-exec
Execute(funcs []func() error, countParallelExec int, errCount int)

Tests

Run the following command from you terminal:

go test -v .

About

Parallel execution of functions on Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages