safe

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContinuesGoRoutine

func ContinuesGoRoutine(c context.Context, f func(x context.CancelFunc) time.Duration, extra ...interface{}) context.Context

ContinuesGoRoutine is a safe go routine system with recovery, its continue after recovery

func GoRoutine

func GoRoutine(c context.Context, f func(), extra ...interface{}) context.Context

GoRoutine is a safe go routine system with recovery and a way to inform finish of the routine

func Register

func Register(hook RecoverHook)

Register is a way to register a hook to trigger after panic

func Routine

func Routine(f func(), extra ...interface{})

func Try

func Try(a func() error, max time.Duration, extra ...interface{})

Types

type RecoverHook

type RecoverHook interface {
	Recover(error, []byte, ...interface{})
}

Jump to

Keyboard shortcuts

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