clean

package
v0.8.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(co *QueueCleaner)

Option - настройка объекта QueueCleaner.

func WithBrokenExpiry

func WithBrokenExpiry(value time.Duration) Option

WithBrokenExpiry - устанавливает опцию brokenExpiry для QueueCleaner.

func WithCompletedExpiry

func WithCompletedExpiry(value time.Duration) Option

WithCompletedExpiry - устанавливает опцию completedExpiry для QueueCleaner.

func WithStorageBroken

func WithStorageBroken(value mrqueue.BrokenStorage) Option

WithStorageBroken - устанавливает опцию storageBroken для QueueCleaner.

func WithStorageCompleted

func WithStorageCompleted(value mrqueue.CompletedStorage) Option

WithStorageCompleted - устанавливает опцию storageCompleted для QueueCleaner.

type QueueCleaner

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

QueueCleaner - объект очищающий очередь от обработанных/сломанных элементов.

func New

func New(
	storage mrqueue.Storage,
	eventEmitter mrsender.EventEmitter,
	errorWrapper mrcore.UseCaseErrorWrapper,
	opts ...Option,
) *QueueCleaner

New - создаёт объект QueueCleaner.

func (*QueueCleaner) RemoveBrokenItems

func (co *QueueCleaner) RemoveBrokenItems(ctx context.Context, limit uint32) (itemsIDs []uint64, err error)

RemoveBrokenItems - удаляет ограниченный список элементов из журнала ошибок. Возвращает ID элементов, которые были удалены.

func (*QueueCleaner) RemoveCompletedItems

func (co *QueueCleaner) RemoveCompletedItems(ctx context.Context, limit uint32) (itemsIDs []uint64, err error)

RemoveCompletedItems - удаляет ограниченный список элементов из успешно обработанных. Возвращает ID элементов, которые были удалены.

func (*QueueCleaner) RemoveItemsWithoutAttempts

func (co *QueueCleaner) RemoveItemsWithoutAttempts(ctx context.Context, limit uint32) (itemsIDs []uint64, err error)

RemoveItemsWithoutAttempts - удаляет из очереди ограниченный список элементов находящихся в статусе RETRY и с нулевым кол-вом попыток в целях разгрузки очереди. Возвращает ID элементов, которые были удалены.

Jump to

Keyboard shortcuts

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