queue_mongo

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CollectionLog = "Log"

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) 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