Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdentifierOfMessage ¶ added in v0.43.0
func IdentifierOfMessage(msg *engine.Message) flow.Identifier
IdentifierOfMessage generates the unique identifier for a message.
func IdentifierOfMessageWithNonce ¶ added in v0.43.0
func IdentifierOfMessageWithNonce(msg *engine.Message) flow.Identifier
IdentifierOfMessageWithNonce generates an identifier with a nonce to prevent de-duplication.
Types ¶
type HeroQueue ¶ added in v0.29.0
type HeroQueue[V any] struct { // contains filtered or unexported fields }
HeroQueue is a generic in-memory queue implementation based on HeroCache. HeroCache is a key-value cache with zero heap allocation and optimized Garbage Collection.
func NewHeroQueue ¶ added in v0.29.0
func NewHeroQueue[V any](sizeLimit uint32, logger zerolog.Logger, collector module.HeroCacheMetrics) *HeroQueue[V]
NewHeroQueue creates a new instance of HeroQueue with the specified size limit.
func (*HeroQueue[V]) Pop ¶ added in v0.29.0
Pop removes and returns the head of queue, and updates the head to the next element. Boolean return value determines whether pop is successful, i.e., popping an empty queue returns false.
type HeroStore ¶ added in v0.29.0
type HeroStore struct {
// contains filtered or unexported fields
}
HeroStore is a FIFO (first-in-first-out) size-bound queue for maintaining engine.Message types. It is based on HeroQueue.
func NewHeroStore ¶ added in v0.29.0
func NewHeroStore(sizeLimit uint32, logger zerolog.Logger, collector module.HeroCacheMetrics, opts ...HeroStoreOption) *HeroStore
func (*HeroStore) Get ¶ added in v0.29.0
Get pops the queue, i.e., it returns the head of queue, and updates the head to the next element. Boolean return value determines whether pop is successful, i.e., popping an empty queue returns false.
type HeroStoreOption ¶ added in v0.33.30
type HeroStoreOption func(heroStore *HeroStore)
func WithMessageKeyFactory ¶ added in v0.43.0
func WithMessageKeyFactory(f KeyFunc) HeroStoreOption
WithMessageKeyFactory allows setting a custom function to generate the key for a message.