tracker

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageTracker

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

MessageTracker is used to store a key value pair for string and *ReadMessage as it can be accessed by concurrent goroutines, we keep all operations under a mutex

func NewMessageTracker

func NewMessageTracker(messages []*isb.ReadMessage) *MessageTracker

NewMessageTracker initializes a new instance of a Tracker

func (*MessageTracker) IsEmpty

func (t *MessageTracker) IsEmpty() bool

IsEmpty is a helper function which checks if the Tracker map is empty return true if empty

func (*MessageTracker) Len

func (t *MessageTracker) Len() int

Len returns the number of messages currently stored in the tracker

func (*MessageTracker) Remove

func (t *MessageTracker) Remove(id string) *isb.ReadMessage

Remove will remove the entry for a given id and return the stored value corresponding to this id. A `nil` return value indicates that the id doesn't exist in the tracker.

Jump to

Keyboard shortcuts

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