lifecycle

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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