Documentation
¶
Index ¶
- type Option
- type QueueCleaner
- func (co *QueueCleaner) RemoveBrokenItems(ctx context.Context, limit uint32) (itemsIDs []uint64, err error)
- func (co *QueueCleaner) RemoveCompletedItems(ctx context.Context, limit uint32) (itemsIDs []uint64, err error)
- func (co *QueueCleaner) RemoveItemsWithoutAttempts(ctx context.Context, limit uint32) (itemsIDs []uint64, err error)
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 ¶
WithBrokenExpiry - устанавливает опцию brokenExpiry для QueueCleaner.
func WithCompletedExpiry ¶
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 элементов, которые были удалены.