logpool

package
v0.0.0-...-beb73e8 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnwrapErr

func UnwrapErr(err error) []error

Types

type InfallibleResultPool

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

func NewInfallibleWithResults

func NewInfallibleWithResults[T any](ctx context.Context, poolLabel string) *InfallibleResultPool[T]

func (*InfallibleResultPool[T]) Go

func (i *InfallibleResultPool[T]) Go(jobLabel string, fn func(context.Context) T)

func (*InfallibleResultPool[T]) Wait

func (i *InfallibleResultPool[T]) Wait(ctx context.Context) []T

type Pool

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

func New

func New(ctx context.Context, poolLabel string) *Pool

func (*Pool) Go

func (p *Pool) Go(jobLabel string, fn func(context.Context) error)

func (*Pool) Wait

func (p *Pool) Wait(ctx context.Context) error

func (*Pool) WithCancelOnError

func (p *Pool) WithCancelOnError() *Pool

func (*Pool) WithFirstError

func (p *Pool) WithFirstError() *Pool

func (*Pool) WithJobCount

func (p *Pool) WithJobCount(count int) *Pool

func (*Pool) WithLogLevel

func (p *Pool) WithLogLevel(level zerolog.Level) *Pool

func (*Pool) WithMaxGoroutines

func (p *Pool) WithMaxGoroutines(routines int) *Pool

type ResultPool

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

func NewWithResults

func NewWithResults[T any](ctx context.Context, poolLabel string) *ResultPool[T]

func (*ResultPool[T]) Go

func (p *ResultPool[T]) Go(jobLabel string, fn func(context.Context) (T, error))

func (*ResultPool[T]) Wait

func (p *ResultPool[T]) Wait(ctx context.Context) ([]T, error)

func (*ResultPool[T]) WithCancelOnError

func (p *ResultPool[T]) WithCancelOnError() *ResultPool[T]

func (*ResultPool[T]) WithFirstError

func (p *ResultPool[T]) WithFirstError() *ResultPool[T]

func (*ResultPool[T]) WithJobCount

func (p *ResultPool[T]) WithJobCount(count int) *ResultPool[T]

func (*ResultPool[T]) WithLogLevel

func (p *ResultPool[T]) WithLogLevel(level zerolog.Level) *ResultPool[T]

func (*ResultPool[T]) WithMaxGoroutines

func (p *ResultPool[T]) WithMaxGoroutines(routines int) *ResultPool[T]

Jump to

Keyboard shortcuts

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