admissiongate

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package admissiongate joins short-lived work before its owner's resources are released.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gate

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

Gate's zero value admits work. Sealing is permanent; role-specific shutdown and the lifetime of resources transferred by admitted work remain with the owner.

func (*Gate) Begin

func (gate *Gate) Begin(caller context.Context) (context.Context, func(), bool)

Begin borrows the caller's context without making it the gate's lifetime. The returned release must follow all cleanup, even after context cancellation.

func (*Gate) Close

func (gate *Gate) Close()

Close also seals the gate, so joining never depends on a caller remembering a separate admission barrier. Concurrent closes join the same admitted work.

func (*Gate) Seal

func (gate *Gate) Seal() bool

Seal rejects new work and cancels admitted work without waiting for cleanup. Only the first caller returns true, allowing one owner to initiate shutdown.

Jump to

Keyboard shortcuts

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