runtime

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package runtime provides utilities for deterministic process management.

It focuses on preventing hangs during shutdown and ensuring cleanup tasks are executed within a specified timeframe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockWithTimeout

func BlockWithTimeout(done <-chan struct{}, timeout time.Duration) error

BlockWithTimeout blocks until the done channel is closed or the timeout expires. It returns nil if the operation completed (channel closed), or context.DeadlineExceeded if the timeout occurred.

Usage:

go func() {
    DoCleanup()
    close(done)
}()
if err := lifecycle.BlockWithTimeout(done, 5*time.Second); err != nil {
    // Force exit or log error
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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