queue

package module
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 1 Imported by: 0

README

gas/queue

Test Go Reference Go Version License

Part of the Gas monorepo · Documentation · All modules

Job queues for the Gas framework, backed by AWS SQS. The interface is pull-based: consumers run their own loop and acknowledge with Ack or Nack.

Implements gas.JobQueueProvider.

go get github.com/gasmod/gas/queue
gas.WithSingletonService[gas.JobQueueProvider](sqs.New()),

sqs.New() needs gas.ConfigProvider and gas.Logger.

Package Provides
queue/sqs AWS SQS, and ElasticMQ via a custom endpoint
queue/queuetest Recording mock of gas.JobQueueProvider

Documentation

The full guide, with configuration, testing, and worked examples, is on the docs site. This README is deliberately a signpost: keeping a second copy here is how the docs drifted before.

License

MIT

Documentation

Overview

Package queue is the root of the Gas job queue module. It holds what every queue backend in the module shares; the backends themselves live in sub-packages: sqs works with AWS SQS (or an SQS-compatible endpoint), and queuetest provides a mock for tests.

Role in the framework

The interface an app enqueues and consumes jobs through, gas.JobQueueProvider, and its types, gas.Job and gas.EnqueueOption, live in core, so app services depend on core and not on this module. This package defines no interface and implements none. It defines the sentinel ErrClosed, which a backend returns from its queue operations once it has been closed.

Wiring, configuration and lifecycle

This package registers nothing, reads no configuration and runs no lifecycle of its own; see the sqs sub-package for the backend's constructor, configuration keys and lifecycle.

See the module README for usage examples and design rationale.

SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClosed is returned when an operation is attempted on a closed
	// queue service.
	ErrClosed = errors.New("queue: service is closed")
)

Sentinel errors returned by JobQueueProvider implementations.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package queuetest provides MockQueue, a mock of core's gas.JobQueueProvider for tests.
Package queuetest provides MockQueue, a mock of core's gas.JobQueueProvider for tests.
Package sqs implements a Gas job queue on AWS SQS, or on an SQS-compatible service through a custom endpoint (for example LocalStack or ElasticMQ).
Package sqs implements a Gas job queue on AWS SQS, or on an SQS-compatible service through a custom endpoint (for example LocalStack or ElasticMQ).

Jump to

Keyboard shortcuts

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