boundedwait

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package boundedwait holds the one piece of a background-loop shutdown that crosses package boundaries: bounded-wait-with-warn — "cancel (or close), wait for the goroutine to exit, but give up and warn once ctx is done", needed by internal/session's liveness poll and by internal/server's ingest queue, update apply and background loop (bgloop.go, which every poller runs on). internal/session must never import internal/server (kb:diagram/daemon-components), so the shared half lives here instead, importing nothing internal itself. Named for the wait, not "lifecycle" — internal/server already uses that word for its own feature Start/Stop interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wait

func Wait(ctx context.Context, wg *sync.WaitGroup, log zerolog.Logger, msg string)

Wait blocks until wg is done, or until ctx is done first — in which case it logs msg at Warn via log and returns without waiting further. The caller is responsible for making wg eventually reach zero (cancel a context, close a channel, whatever the loop needs); Wait only owns the "did it stop in time" half.

Types

This section is empty.

Jump to

Keyboard shortcuts

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