gcall

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPanicCallback

func AddPanicCallback(cb func(x any, stack string))

func Call

func Call(fn ...func())

func CallWithTimeout

func CallWithTimeout(duration time.Duration, fn ...func()) (timeout bool)

func Go

func Go(fn ...func())

func GoWithDeadline

func GoWithDeadline(deadline time.Time, fns ...func())

GoWithDeadline 执行多个协程(附带最后期限)

func GoWithTimeout

func GoWithTimeout(timeout time.Duration, fns ...func())

GoWithTimeout 执行多个协程(附带超时时间)

func Goes

func Goes(fn ...func())

func Method

func Method(v any, methodName string, in ...any) ([]any, error)

func Recover

func Recover(args ...interface{}) any

func ThroughMethod

func ThroughMethod(structs ...any)

func WrapperFuncs

func WrapperFuncs(fn ...func()) func()

Types

type Goroutines

type Goroutines struct {
	// contains filtered or unexported fields
}

func NewGoroutines

func NewGoroutines() *Goroutines

func (*Goroutines) Add

func (g *Goroutines) Add(fns ...func()) *Goroutines

Add 添加协程函数

func (*Goroutines) Run

func (g *Goroutines) Run(ctx context.Context, timeout ...time.Duration)

Run 运行协程函数

Jump to

Keyboard shortcuts

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