Help us shape the future of Go! Take the 2026 Go Developer Survey

threshold

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ThresholdExecute

type ThresholdExecute[ITEM any] struct {
	// contains filtered or unexported fields
}

ThresholdExecute 阈值执行, 超过阈值就执行

func NewThresholdExecute

func NewThresholdExecute[ITEM any](periodic time.Duration, itemDo func(i int, item *ITEM)) *ThresholdExecute[ITEM]

func (*ThresholdExecute[ITEM]) Collect

func (exec *ThresholdExecute[ITEM]) Collect(item *ITEM)

Collect 收集数据

func (*ThresholdExecute[ITEM]) SetRecover

func (pe *ThresholdExecute[ITEM]) SetRecover(recoverDo func(ierr any))

func (*ThresholdExecute[ITEM]) Stop

func (pe *ThresholdExecute[ITEM]) Stop()

Stop 停止执行

Jump to

Keyboard shortcuts

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