mutexqueue

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

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

This section is empty.

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) *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) Drop

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

Drop drops

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) PopNWithMetadata

func (s *MQEventsStorage) PopNWithMetadata(n int64) ([]dtos.QueueStoredEventDTO, error)

PopNWithMetadata 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 NewMQImpressionsStorage

func NewMQImpressionsStorage(queueSize int, isFull chan<- string, logger logging.LoggerInterface) *MQImpressionsStorage

NewMQImpressionsStorage returns an instance of MQEventsStorage

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) 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