lifecycle

package
v0.4.0-rc.5-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 3 Imported by: ? 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 lifecycle owns process lifecycle state shared by backend and frontend runtimes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DrainLifecycle

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

DrainLifecycle tracks whether a process has started graceful drain.

func NewDrainLifecycle

func NewDrainLifecycle() *DrainLifecycle

NewDrainLifecycle creates process-local drain state for readiness checks and shutdown.

func (*DrainLifecycle) BeginDrain

func (d *DrainLifecycle) BeginDrain() bool

BeginDrain marks the process as draining and reports whether this call changed state.

func (*DrainLifecycle) IsDraining

func (d *DrainLifecycle) IsDraining() bool

IsDraining reports whether readiness should reject new traffic for shutdown drain.

func (*DrainLifecycle) WaitDrainWindow

func (d *DrainLifecycle) WaitDrainWindow(ctx context.Context, duration time.Duration) error

WaitDrainWindow waits for external traffic routing to observe not-ready state.

Jump to

Keyboard shortcuts

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