async

package
v0.0.0-...-80d8d71 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEach

func ForEach[T any](items []T, fn func(int, T))

Types

type ErrorPool

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

func (*ErrorPool) Go

func (p *ErrorPool) Go(fn func() error)

func (*ErrorPool) Wait

func (p *ErrorPool) Wait() error

type Iterator

type Iterator[T any] struct {
	MaxWorkers int
}

func (Iterator[T]) ForEach

func (iter Iterator[T]) ForEach(items []T, fn func(int, T))

type Pool

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

func NewPool

func NewPool() *Pool

func (*Pool) Go

func (p *Pool) Go(fn func())

func (*Pool) Wait

func (p *Pool) Wait()

func (*Pool) WithErrors

func (p *Pool) WithErrors() *ErrorPool

func (*Pool) WithMaxWorkers

func (p *Pool) WithMaxWorkers(limit int) *Pool

type ResultPool

type ResultPool[T any] struct {
	// contains filtered or unexported fields
}

func NewResultPool

func NewResultPool[T any]() *ResultPool[T]

func (*ResultPool[T]) Go

func (p *ResultPool[T]) Go(fn func() (T, error))

func (*ResultPool[T]) Wait

func (p *ResultPool[T]) Wait() ([]T, error)

type WaitGroup

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

func (*WaitGroup) Go

func (p *WaitGroup) Go(fn func())

func (*WaitGroup) Wait

func (p *WaitGroup) Wait()

func (*WaitGroup) WaitAndCatch

func (p *WaitGroup) WaitAndCatch() *safe.RecoveredPanic

func (*WaitGroup) WaitErr

func (p *WaitGroup) WaitErr() error

Jump to

Keyboard shortcuts

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