pool

package
v0.0.0-...-22113b6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxWorkers int `yaml:"max_workers"`
	QueueDepth int `yaml:"queue_depth"`
}

type JobFunc

type JobFunc func(ctx context.Context, payload interface{}) (interface{}, error)

type Pool

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

func NewPool

func NewPool(cfg *Config) *Pool

func (*Pool) RunJobs

func (p *Pool) RunJobs(ctx context.Context, payloads []interface{}, fn JobFunc) ([]interface{}, []error, error)

func (*Pool) Shutdown

func (p *Pool) Shutdown()

Jump to

Keyboard shortcuts

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