netcache

package
v0.37.0-crescendo-RC8-... Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReceiveCache

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

ReceiveCache implements an LRU cache of the received eventIDs that delivered to their engines

func NewHeroReceiveCache added in v0.25.2

func NewHeroReceiveCache(sizeLimit uint32, logger zerolog.Logger, collector module.HeroCacheMetrics,
) *ReceiveCache

NewHeroReceiveCache returns a new HeroCache-based receive cache.

func NewReceiveCache

func NewReceiveCache(sizeLimit uint, opts ...func(cache *ReceiveCache)) *ReceiveCache

NewReceiveCache creates and returns a new ReceiveCache

func (*ReceiveCache) Add

func (r *ReceiveCache) Add(eventID []byte) bool

Add adds a new message to the cache if not already present. Returns true if the message is new and unseen, and false if message is duplicate, and already has been seen by the node.

func (*ReceiveCache) Size added in v0.25.2

func (r *ReceiveCache) Size() uint

Jump to

Keyboard shortcuts

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