dropevents

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Fibonacci        = "fibonacci"
	Sequence         = "sequence"
	SkipAlgorithmKey = "SKIP_ALGORITHM"
	NumberKey        = "NUMBER"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterHandler

type CounterHandler struct {
	Skipper Skipper
	sync.Mutex
	// contains filtered or unexported fields
}

func (*CounterHandler) Skip

func (h *CounterHandler) Skip() bool

type Skipper

type Skipper interface {
	// Skip returns true if the message must be rejected
	Skip(counter uint64) bool
}

Skipper represents the logic to apply to accept/reject events.

func SkipperAlgorithm

func SkipperAlgorithm(algorithm string) Skipper

func SkipperAlgorithmWithCount added in v0.17.8

func SkipperAlgorithmWithCount(algorithm string, count uint64) Skipper

count is only used for SKIP_ALGORITHM=Sequence.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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