queue_filesystem

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: 7 Imported by: 0

Documentation

Overview

Package queue_filesystem provides a queue storage backed by the filesystem

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 simplified queue Storage interface using a filesystem. This storage engine does not support duplicate checking. It returns a single task at a time, probably in order of creation time (but no guarantees are made). This storage engine is not safe for concurrent access by multiple workers.

func New

func New(directory string) 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(_ 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