Documentation
¶
Overview ¶
Package runtime provides utilities for deterministic process management and boilerplate reduction.
It focuses on:
- Preventing hangs during shutdown (timeouts).
- Standardizing application entry points (Run).
- Providing context-aware primitives (Sleep).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockWithTimeout ¶
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.
Click to show internal directories.
Click to hide internal directories.