queuepause

package
v0.3.0-20261015232424-... Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

README

Queue Pause Extension

Vendor-agnostic source of per-queue pause state. See the pause and unpause RFC for the design.

Interfaces

Store

Returns the pause state of a queue by name. The state is two independent switches: reject new land requests, and freeze processing of accepted requests. A queue with no entry is not paused, and an error means the backend could not be read.

The store only reports state. The gateway and orchestrator enforce it, so every deployment runs the same rejection and freezing logic and only the source of the state differs.

Implementations

  • noop never pauses a queue. It is the default when no pause state is configured.

  • file reads a YAML file listing the queues that have switches set, and re-reads it on every Get, so editing the file pauses or unpauses a queue without a restart. The file must exist and parse when the store is constructed, so a mistyped path fails at startup. A later read or parse failure is returned as an error and never treated as not paused. Unknown fields are rejected so a misspelled switch cannot silently leave a queue unpaused.

  • fake is an in-memory store for tests. A test sets a queue's state, changes it while consumers run, and can make every read fail. It is never used in production.

A deployer can supply its own implementation backed by a config service.

Entities

QueuePause lives in submitqueue/entity/queue_pause.go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Get returns the current pause state of a queue. A queue with no entry
	// returns the zero state (not paused) and no error. A non-nil error means
	// the backend could not be read, not that the queue is unpaused; a caller
	// that enforces a switch must not fail open on it. Implementations must be
	// safe for concurrent use.
	Get(ctx context.Context, queue string) (entity.QueuePause, error)
}

Store is the source of per-queue pause state. It reports the switches and decides nothing; enforcement lives in the services that resolve it.

Directories

Path Synopsis
Package fake provides an in-memory queuepause.Store for tests and examples.
Package fake provides an in-memory queuepause.Store for tests and examples.
Package file provides a YAML-file-backed implementation of queuepause.Store.
Package file provides a YAML-file-backed implementation of queuepause.Store.
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package noop provides a queuepause.Store under which no queue is ever paused.
Package noop provides a queuepause.Store under which no queue is ever paused.

Jump to

Keyboard shortcuts

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