lifecycle

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package lifecycle owns the daemon shutdown sequence: once the reviewer finalizes the session, linger briefly so the browser can render the success state, then gracefully shut down the HTTP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitFinalizeThenShutdown

func WaitFinalizeThenShutdown(ctx context.Context, done <-chan struct{}, srv *http.Server, opts Options) error

WaitFinalizeThenShutdown blocks until `done` is closed, then lingers for opts.Linger, then gracefully shuts down srv with opts.ShutdownTimeout. If ctx is canceled first, the linger is skipped and the function returns ctx.Err() (after attempting a best-effort shutdown).

Types

type Options

type Options struct {
	Linger          time.Duration
	ShutdownTimeout time.Duration
}

Options tunes the linger and graceful-shutdown windows.

Jump to

Keyboard shortcuts

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