Skip to content

bep/workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests Go Report Card GoDoc

A simple Go library to set up tasks to be executed in parallel.

package main

import (
	"context"
	"log"

	"github.com/bep/workers"
)

func main() {
	// Max 4 tasks to be executed in parallel.
	w := workers.New(4)
	r, _ := w.Start(context.Background())

	r.Run(func() error {
		return nil
	})

	// ... run more tasks.

	if err := r.Wait(); err != nil {
		log.Fatal(err)
	}
}

About

Set up tasks to be executed in parallel.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages