notifylimiter

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter struct {
	baseservice.BaseService
	// contains filtered or unexported fields
}

func NewLimiter

func NewLimiter(archetype *baseservice.Archetype, waitDuration time.Duration) *Limiter

NewLimiter creates a new Limiter, calling the NotifyFunc no more than once per waitDuration. The function must be fast as it is called within a mutex.

func (*Limiter) ShouldTrigger

func (l *Limiter) ShouldTrigger(topic string) bool

type NotifyFunc

type NotifyFunc func(name string)

Jump to

Keyboard shortcuts

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