queue

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package queue defines the task queue contract. the Queue port, and the channel→subject mapping. The outbox-backed implementation lives in adapters/outbox_queue.

Index

Constants

View Source
const DefaultChannel = "default"

DefaultChannel is the channel used by Enqueue. Callers that do not care about channels and prioritization never name a channel; the transport layer routes them here.

Variables

This section is empty.

Functions

func Subject

func Subject(channel, name string) string

Subject composes the wire message queue subject for a task on a channel: queues.<channel>.<name>.

Types

type Queue

type Queue interface {
	Enqueue(ctx context.Context, t Task) error
	EnqueueOn(ctx context.Context, channel string, t Task) error
}

Queue enqueues tasks for asynchronous, single-consumer execution. Enqueue uses the default channel; EnqueueOn routes onto a named channel (e.g. a priority lane).

type Task

type Task interface {
	Name() string
	Version() string
}

Task is the constraint for queueable point-to-point work units. A task names itself logically (e.g. "log-created-asset") and declares its schema version. The transport channel is an infrastructure concern composed at enqueue time and not tied to task itself.

Jump to

Keyboard shortcuts

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