gate

package
v0.6.46 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gate admits internal API calls only while the author's tree is up: before it started they get Unavailable, and stopping waits for the calls in flight before the tree (and its dependencies) stops. When the stop budget runs out first, the contexts of the calls still running are cancelled, so a long stream ends instead of outliving the tree. Health is never gated.

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 tracks admitted calls.

func New

func New() *Gate

New creates a closed gate.

func (*Gate) Close

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

Close stops admitting and waits for admitted calls within ctx. When ctx ends first, it cancels the contexts of the calls still running and reports them.

func (*Gate) Open

func (g *Gate) Open()

Open admits calls.

func (*Gate) ServerOptions

func (g *Gate) ServerOptions() []grpc.ServerOption

ServerOptions installs the gate on a gRPC server.

Jump to

Keyboard shortcuts

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