admission

package
v0.3.0-beta.32 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package admission owns the daemon-wide new-work admission boundary.

Index

Constants

This section is empty.

Variables

View Source
var ErrDraining = errors.New("daemon is draining; new work admission is closed")

ErrDraining reports that the daemon is temporarily refusing new work.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Check(context.Context) error
}

Checker is the read-only admission surface injected into work owners.

type Gate

type Gate struct {
	// contains filtered or unexported fields
}

Gate is a concurrency-safe, in-memory daemon admission gate.

func (*Gate) Check

func (g *Gate) Check(ctx context.Context) error

Check admits active daemons and rejects new work while draining.

func (*Gate) Drain

func (g *Gate) Drain() bool

Drain closes the gate and reports whether this call changed the state.

func (*Gate) State

func (g *Gate) State() State

State returns the current admission state.

func (*Gate) Undrain

func (g *Gate) Undrain() bool

Undrain opens the gate and reports whether this call changed the state.

type State

type State string

State is the closed set of daemon admission states.

const (
	StateActive   State = "active"
	StateDraining State = "draining"
)

Jump to

Keyboard shortcuts

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