queuecache

package
v6.0.0-...-4ba06ae Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryQueueCacheOverlay

type InMemoryQueueCacheOverlay[T any] 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[T any](maxSize int, refillFunc func(count int) ([]T, error)) *InMemoryQueueCacheOverlay[T]

New creates a new InMemoryQueueCacheOverlay

func (*InMemoryQueueCacheOverlay[T]) Count

func (i *InMemoryQueueCacheOverlay[T]) Count() int

Count returns the number of cached items

func (*InMemoryQueueCacheOverlay[T]) Fetch

func (i *InMemoryQueueCacheOverlay[T]) Fetch(requestedCount int) ([]T, 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