Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OnPanic = func(r interface{}) { syslog.Errorf("panic: %v\n%s", r, debug.Stack()) }
OnPanic is a global callback function triggered when a panic occurs.
Functions ¶
This section is empty.
Types ¶
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status provides a mechanism to wait for a goroutine to finish.
func Go ¶
Go runs a goroutine safely with context support and panic recovery. It ensures the process does not crash due to an uncaught panic in the goroutine.
type ValueStatus ¶
type ValueStatus[T any] struct { // contains filtered or unexported fields }
ValueStatus provides a mechanism to wait for a goroutine that returns a value and an error.
func GoValue ¶
GoValue runs a goroutine safely with context support and panic recovery and returns its result and error. It ensures the process does not crash due to an uncaught panic in the goroutine.
func (*ValueStatus[T]) Wait ¶
func (s *ValueStatus[T]) Wait() (T, error)
Wait blocks until the goroutine finishes and returns its result and error.
Click to show internal directories.
Click to hide internal directories.