congroup

package module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 11 Imported by: 0

README

congroup

Documentation

Index

Constants

View Source
const (
	DefaultConcurrency = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOpt added in v2.0.1

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

func AddOption added in v2.0.1

func AddOption() *AddOpt

func (*AddOpt) GetLabel added in v2.0.1

func (o *AddOpt) GetLabel() string

func (*AddOpt) SetLabel added in v2.0.1

func (o *AddOpt) SetLabel(l string) *AddOpt

SetLabel 对任务设置label,用于tracing时的区分

type ConGroup

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

func New

func New(ctx context.Context, opts ...*NewOpt) *ConGroup

func (*ConGroup) Add

func (g *ConGroup) Add(h Handler, opts ...*AddOpt)

func (*ConGroup) Wait

func (g *ConGroup) Wait() error

type Handler

type Handler func(context.Context) error

type NewOpt added in v2.0.1

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

func NewOption added in v2.0.1

func NewOption() *NewOpt

func (*NewOpt) GetMaxConcurrency added in v2.0.1

func (o *NewOpt) GetMaxConcurrency() uint

func (*NewOpt) SetMaxConcurrency added in v2.0.1

func (o *NewOpt) SetMaxConcurrency(c uint) *NewOpt

SetMaxConcurrency 设置执行handler时的最大并发数,大于0有效,默认DefaultConcurrency

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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