Skip to content

eunomie/parallel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parallel

import (
	"context"

	"github.com/eunomie/parallel"
)

type InputType struct {
	//...
}

type OutputType struct {
	//...
}

func test(ctx context.Context, inputs []InputType) {
    err, result := parallel.Do[InputType, OutputType](
        ctx,
        inputs,
        func(context.Context, InputType) (OutputType, error) {
            return OutputType{/* ... */}, nil
        },
        parallel.WithLimit(2),
    )

    //...
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages