queuecache

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryQueueCacheOverlay

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

InMemoryQueueCacheOverlay offers an in-memory queue that gets re-populated whenever it runs out of items

func New

func New(maxSize int, refillFunc func(count int) ([]interface{}, error)) *InMemoryQueueCacheOverlay

New creates a new InMemoryQueueCacheOverlay

func (*InMemoryQueueCacheOverlay) Count

func (i *InMemoryQueueCacheOverlay) Count() int

Count returns the number of cached items

func (*InMemoryQueueCacheOverlay) Fetch

func (i *InMemoryQueueCacheOverlay) Fetch(requestedCount int) ([]interface{}, error)

Fetch items (will re-populate if necessary)

type MessagesDroppedError

type MessagesDroppedError struct {
	MessagesDropped int
}

MessagesDroppedError is the Error to be returned when messages fail to be added to the queue.

func (*MessagesDroppedError) Error

func (e *MessagesDroppedError) Error() string

type RefillError

type RefillError struct {
	OriginalPanic interface{}
}

RefillError struct to be returned when the refill function panics

func (*RefillError) Error

func (e *RefillError) Error() string

Jump to

Keyboard shortcuts

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