queue

package
v0.0.0-...-f1cee2f Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package queue abstracts the various external (or internal) message queues we are using for notifications

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTimeout is returned if receive encounters a timeout
	ErrTimeout = errors.New("timeout occurred")
	// ErrClosed is returned if you try to access a closed queue
	ErrClosed = errors.New("queue is already closed")
)

Functions

func NewDBQueue

func NewDBQueue(r *repo.MySQL) *dbQueue

Types

type Queue

type Queue interface {
	PushConf(team string) error
	PopConf(timeout time.Duration) (string, error)
	PushWork(work *domain.WorkRequest) error
	PopWork(timeout time.Duration) (*domain.WorkRequest, error)
	PushWorkReply(replyQueue string, reply *domain.WorkReply) error
	PopWorkReply(replyQueue string, timeout time.Duration) (*domain.WorkReply, error)
	Close() error
}

Queue abstracts the external / internal queues

func New

func New(r *repo.MySQL) (Queue, error)

New queue is returned depending on environment

Jump to

Keyboard shortcuts

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