gopool

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 3 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 {
	ScaleThreshold int32
}

func NewConfig

func NewConfig() *Config

type Pool

type Pool interface {
	Name() string
	// SetCap sets the goroutine capacity of the pool.
	SetCap(cap int32)
	// Go executes f.
	Go(fn func(), panicHandler func(context.Context))
	// GoCtx executes f and accepts the context.
	GoCtx(ctx context.Context, f func(), panicHandler func(context.Context))
	// SetPanicHandler sets the panic handler.
	SetPanicHandler(f func(context.Context))
	// WorkerCount returns the number of running workers
	WorkerCount() int32
}

func NewPool

func NewPool(name string, cap int32, config *Config) Pool

Jump to

Keyboard shortcuts

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