runtime

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PanicHandlers = []func(interface{}){logPanic}

Functions

func Call

func Call(callers ...errCaller) error

Call 同步依次执行函数,只要有一个返回err,直接返回 通过此方法可以减少if err != nil { return }的判断

func Goroutine

func Goroutine(fn func())

func GoroutineRecover

func GoroutineRecover(fn func(), callback func(reason interface{}))

func HandleCrash

func HandleCrash(additionalHandlers ...func(interface{}))

func HandlerError

func HandlerError(err error, fn func(err error))

func SetReallyCrash

func SetReallyCrash(really bool)

func Shutdown

func Shutdown(callback func())

shutdown 关闭服务

func WaitClose

func WaitClose(stop <-chan struct{}, closeFunc ...func())

WaitClose is a helper function that waits for the channel to close and invoke the callback

Types

This section is empty.

Jump to

Keyboard shortcuts

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