queue_mongo

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package queue_mongo provides a queue storage backed by MongoDB

Index

Constants

View Source
const CollectionLog = "QueueErrors"

CollectionLog is the name of the mongodb collection where completed/logged tasks are stored

View Source
const CollectionQueue = "Queue"

CollectionQueue is the name of the mongodb collection where queued tasks are stored

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage implements a queue Storage interface using MongoDB

func New

func New(database *mongo.Database, lockQuantity int, timeoutMinutes int) Storage

New returns a fully initialized Storage object

func (Storage) DeleteTask

func (storage Storage) DeleteTask(taskID string) error

DeleteTask removes a task from the queue

func (Storage) DeleteTaskBySignature added in v0.4.1

func (storage Storage) DeleteTaskBySignature(signature string) error

DeleteTaskBySignature removes a task from the queue by its signature

func (Storage) GetTasks

func (storage Storage) GetTasks() ([]queue.Task, error)

GetTasks returns all tasks that are currently locked by this worker

func (Storage) LogFailure

func (storage Storage) LogFailure(task queue.Task) error

LogFailure adds a task to the error log

func (Storage) SaveTask

func (storage Storage) SaveTask(task queue.Task) error

SaveTask adds/updates a task to the queue

Jump to

Keyboard shortcuts

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