memqueue

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package memqueue is an in-process implementation of queue.Queue, backed by mutex-protected slices instead of Redis. Intended for tests, local development, and running pulse without any external infra — not a high-throughput production primitive (DequeuePriorityBlocking polls rather than blocking on a true wakeup signal).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue is an in-process priority queue with delayed scheduling and a DLQ.

func New

func New() *Queue

New returns an empty Queue.

func (*Queue) DequeuePriorityBlocking

func (q *Queue) DequeuePriorityBlocking(timeout time.Duration) (string, string, error)

DequeuePriorityBlocking polls (rather than blocking on a true wakeup signal) until an item is available or timeout elapses.

func (*Queue) EnqueueToDLQ

func (q *Queue) EnqueueToDLQ(taskID string) error

func (*Queue) EnqueueWithPriority

func (q *Queue) EnqueueWithPriority(taskID, priority string) error

func (*Queue) GetDLQItems

func (q *Queue) GetDLQItems() ([]string, error)

func (*Queue) GetQueueDepths

func (q *Queue) GetQueueDepths() (map[string]int64, error)

func (*Queue) PromoteScheduled

func (q *Queue) PromoteScheduled() error

func (*Queue) RemoveFromDLQ

func (q *Queue) RemoveFromDLQ(taskID string) error

func (*Queue) Schedule

func (q *Queue) Schedule(taskID, priority string, executeAt time.Time) error

Jump to

Keyboard shortcuts

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