buf: github.com/bufbuild/buf/internal/pkg/thread Index | Files

package thread

import "github.com/bufbuild/buf/internal/pkg/thread"

Index

Package Files

thread.go

func Parallelism Uses

func Parallelism() int

Parallelism returns the current parellism.

This defaults to the number of CPUs.

func Parallelize Uses

func Parallelize(jobs ...func() error) error

Parallelize runs the jobs in parallel.

A max of Parallelism jobs will be run at once. Returns the combined error from the jobs.

func SetParallelism Uses

func SetParallelism(parallelism int)

SetParallelism sets the parallelism.

If parallelism < 1, this sets the parallelism to 1.

Package thread imports 3 packages (graph) and is imported by 4 packages. Updated 2020-10-20. Refresh now. Tools for package owners.