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 ¶
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.