queue

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package queue provides a job queue abstraction. The default runs jobs in-process (async goroutines); a Redis/NATS-backed queue ships as a plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(ctx context.Context, payload any) error

Handler processes a dispatched job payload.

type Queue

type Queue interface {
	Handle(name string, h Handler)
	Dispatch(ctx context.Context, name string, payload any) error
}

Queue dispatches named jobs to registered handlers.

func NewMemory

func NewMemory(onError func(error)) Queue

NewMemory returns an in-process queue. onError (optional) receives async errors.

Jump to

Keyboard shortcuts

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