concurrencyCfg

package
v0.0.0-...-fc8e49a Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrencyConfig

type ConcurrencyConfig struct {
	SendChanTimeout time.Duration `json:"send_chan_timeout"`
	ChanSize        int           `json:"chan_size"`
	ChanNum         int           `json:"chan_num"`
}

type Config

type Config struct {
	Logger logger.LoggerInterface

	ConcurrencyFn     func(ctx context.Context, p define.Packet) `json:"-"`
	ConcurrencyConfig *ConcurrencyConfig                         `json:"concurrency_config"`
}

func InitConfig

func InitConfig(options ...Option) *Config

func NewDefaultConfig

func NewDefaultConfig() *Config

type Option

type Option func(c *Config)

func WithConcurrencyChanNum

func WithConcurrencyChanNum(chanNum int) Option

func WithConcurrencyChanSize

func WithConcurrencyChanSize(chanSize int) Option

func WithConcurrencyFn

func WithConcurrencyFn(fn func(ctx context.Context, p define.Packet)) Option

func WithConcurrencySendChanTimeout

func WithConcurrencySendChanTimeout(sendChanTimeout time.Duration) Option

func WithLogger

func WithLogger(logger logger.LoggerInterface) Option

Jump to

Keyboard shortcuts

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