threadpkg

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoSafe

func GoSafe(fn func())

GoSafe runs the given fn using another goroutine, recovers if fn panics.

func GoWithCtx

func GoWithCtx(ctx context.Context, fn func(ctx context.Context))

GoWithCtx 新开启协程执行fn,并将trace-id传递到新的协程

func Recover

func Recover(cleanups ...func())

Recover is used with defer to do cleanup on panics. Use it like: defer Recover(func() {})

Types

This section is empty.

Jump to

Keyboard shortcuts

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