coroutine

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Concurrent added in v0.5.0

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

func NewConcurrent

func NewConcurrent(max int) *Concurrent

func (*Concurrent) Close added in v0.5.0

func (c *Concurrent) Close()

Close the concurrent ch

func (*Concurrent) Run added in v0.5.0

func (c *Concurrent) Run(fn func())

Run runs a function in a goroutine, but limits the amount goroutines running at the same time. Warning: Please pay attention to the scope of variables in the function.

type Parallel

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

func NewParallel

func NewParallel(max int) *Parallel

func (*Parallel) Add added in v0.5.0

func (p *Parallel) Add(fn ...func())

func (*Parallel) Wait added in v0.5.0

func (p *Parallel) Wait()

Jump to

Keyboard shortcuts

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