mutexqueue

package
v6.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MaxAccumulatedBytes = 5 * 1024 * 1024

MaxAccumulatedBytes is the maximum size to accumulate in events before flush (in bytes)

Variables

View Source
var ErrorMaxSizeReached = errors.New("Queue max size has been reached")

ErrorMaxSizeReached queue max size error

Functions

func NewMQImpressionsStorage

func NewMQImpressionsStorage(queueSize int, isFull chan<- string, logger logging.LoggerInterface, runtimeTelemetry storage.TelemetryRuntimeProducer) storage.ImpressionStorage

NewMQImpressionsStorage returns an instance of MQEventsStorage

Types

type MQEventsStorage

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

MQEventsStorage in memory events storage

func NewMQEventsStorage

func NewMQEventsStorage(queueSize int, isFull chan string, logger logging.LoggerInterface, runtimeTelemetry storage.TelemetryRuntimeProducer) *MQEventsStorage

NewMQEventsStorage returns an instance of MQEventsStorage

func (*MQEventsStorage) Count

func (s *MQEventsStorage) Count() int64

Count returns the number of events into slice

func (*MQEventsStorage) Empty

func (s *MQEventsStorage) Empty() bool

Empty returns if slice len if zero

func (*MQEventsStorage) PopN

func (s *MQEventsStorage) PopN(n int64) ([]dtos.EventDTO, error)

PopN pop N elements from queue

func (*MQEventsStorage) Push

func (s *MQEventsStorage) Push(event dtos.EventDTO, size int) error

Push an event into slice

type MQImpressionsStorage

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

MQImpressionsStorage in memory events storage

func (*MQImpressionsStorage) Count

func (s *MQImpressionsStorage) Count() int64

Count returns len

func (*MQImpressionsStorage) Drop

func (s *MQImpressionsStorage) Drop(size *int64) error

Drop drops

func (*MQImpressionsStorage) Empty

func (s *MQImpressionsStorage) Empty() bool

Empty returns if slice len if zero

func (*MQImpressionsStorage) LogImpressions

func (s *MQImpressionsStorage) LogImpressions(impressions []dtos.Impression) error

LogImpressions inserts impressions into the queue

func (*MQImpressionsStorage) PopN

PopN pop N elements from queue

func (*MQImpressionsStorage) PopNRaw

func (s *MQImpressionsStorage) PopNRaw(n int64) ([]string, int64, error)

PopNRaw pop N elements from queue

func (*MQImpressionsStorage) PopNWithMetadata

func (s *MQImpressionsStorage) PopNWithMetadata(n int64) ([]dtos.ImpressionQueueObject, error)

PopNWithMetadata pop N elements from queue

Jump to

Keyboard shortcuts

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