goqueue

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 8 Imported by: 0

README

goqueue

Go package goqueue wraps github.com/joncrlsn/dque for use in Go projects.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// QueueSize message queue size on gobelisk.
	QueueSize        = prometheus.NewGaugeVec(prometheus.GaugeOpts{}, []string{"name"})
	QueueErrorsCount = prometheus.NewCounterVec(prometheus.CounterOpts{}, []string{"name"})
)

Functions

func PrometheusCollectors

func PrometheusCollectors(namespace string) []prometheus.Collector

PrometheusCollectors gives a slice fo all Prometheus metrics that this library uses. These will have to be registered to the Prometheus library in your application.

Types

type Queue

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

Queue wraps a Queues, for a single queue.

func NewQueue

func NewQueue(queueName string, queues *Queues) Queue

NewQueue creates a Queue wrapper.

func (Queue) Enqueue

func (q Queue) Enqueue(inter interface{}) error

Enqueue enqueues an interface object to its queue.

type QueueDef

type QueueDef struct {
	Name        string
	Builder     func() interface{}
	Location    string
	TurboMode   bool
	SegmentSize int
	// contains filtered or unexported fields
}

type Queues

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

Queues represents an implementation of a persistent queue in disk, containing multiple QueueDefs.

func NewQueues

func NewQueues(registeredInterfaces []interface{}) *Queues

NewQueues creates, init and returns a Queue.

func (*Queues) AddDef

func (q *Queues) AddDef(name string, queueDef *QueueDef)

func (*Queues) Attach

func (q *Queues) Attach(queue string, handler func(interface{}) (reEnqueue bool, err error)) error

Attach will add a new observer related with the CABStatus events.

func (*Queues) Enqueue

func (q *Queues) Enqueue(queue string, inter interface{}) error

Enqueue enqueues an interface object to its queue.

func (*Queues) OpenQueues

func (q *Queues) OpenQueues()

func (*Queues) Shutdown

func (q *Queues) Shutdown()

Source Files

  • def.go
  • metrics.go
  • queue.go

Jump to

Keyboard shortcuts

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