concurrent

package
v4.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 2 Imported by: 8 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailFast added in v4.30.4

type FailFast struct {
	// contains filtered or unexported fields
}

FailFast describes a task group with a fail-fast approach

func NewFailFast added in v4.30.4

func NewFailFast(limit uint64) *FailFast

NewFailFast creates a Group with given concurrency limit

func (*FailFast) Go added in v4.30.4

func (g *FailFast) Go(f func() error)

Go run given function in a goroutine according to limiter and current status

func (*FailFast) Wait added in v4.30.4

func (g *FailFast) Wait() error

Wait for Group to end

func (*FailFast) WithContext added in v4.30.4

func (g *FailFast) WithContext(ctx context.Context) context.Context

WithContext make the given context cancelable for the group

type Limited added in v4.30.4

type Limited struct {
	// contains filtered or unexported fields
}

Limited describes a task group with limited parallelism

func NewLimited added in v4.30.4

func NewLimited(limit uint64) *Limited

NewLimited creates a Limited with given concurrency limit

func (*Limited) Go added in v4.30.4

func (g *Limited) Go(f func())

Go run given function in a goroutine according to limiter

func (*Limited) Wait added in v4.30.4

func (g *Limited) Wait()

Wait for Limited to end

type Simple added in v4.33.0

type Simple struct {
	// contains filtered or unexported fields
}

Simple describes a task group with simple parallelism

func NewSimple added in v4.33.0

func NewSimple() *Simple

NewSimple creates a Simple concurrent pattern

func (*Simple) Go added in v4.33.0

func (g *Simple) Go(f func())

Go run given function in a goroutine

func (*Simple) Wait added in v4.33.0

func (g *Simple) Wait()

Wait for Simple to end

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL