ants

package
v1.3.40 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go

func Go(task func())

func NewPool

func NewPool(size int, options ...PoolOption)

func Pool

func Pool() *ants.Pool

Types

type PoolConfig

type PoolConfig struct {
	ExpiryDuration time.Duration
	SubmitTimeout  time.Duration
	SubmitInterval time.Duration
	Logger         PoolLogger
	PanicHandler   func(interface{})
}

func Config

func Config() *PoolConfig

type PoolLogger

type PoolLogger interface {
	ants.Logger
	SendMessage(msg string)
	LogName() string
}

type PoolOption

type PoolOption func(c *PoolConfig)

func WithExpiryDuration

func WithExpiryDuration(t time.Duration) PoolOption

func WithLogger

func WithLogger(logger PoolLogger) PoolOption

func WithPanicHandler

func WithPanicHandler(h func(interface{})) PoolOption

func WithSubmitInterval

func WithSubmitInterval(t time.Duration) PoolOption

func WithSubmitTimeout

func WithSubmitTimeout(t time.Duration) PoolOption

Jump to

Keyboard shortcuts

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