queue

package
v0.0.0-...-6dc04ce Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package queue provides queue implementations for task processing. This package implements the queue.TaskQueue interface using SQLite as the underlying storage. It uses the goqite library for reliable queue operations and maintains a separate table for tracking failed tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteQueue

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

SQLiteQueue implements queue.TaskQueue using goqite

func NewSQLiteQueue

func NewSQLiteQueue(db *sqlx.DB, queueName string) (*SQLiteQueue, error)

NewSQLiteQueue creates a new SQLiteQueue

func (*SQLiteQueue) Complete

func (q *SQLiteQueue) Complete(ctx context.Context, taskID string) error

Complete marks a task as completed

func (*SQLiteQueue) Dequeue

func (q *SQLiteQueue) Dequeue(ctx context.Context) (*queue.Task, error)

Dequeue gets a task from the queue

func (*SQLiteQueue) Enqueue

func (q *SQLiteQueue) Enqueue(ctx context.Context, payload uint) error

func (*SQLiteQueue) Fail

func (q *SQLiteQueue) Fail(ctx context.Context, taskID string, errMsg string) error

Fail marks a task as failed, stores it in the failed_tasks table, and removes it from the queue

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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