xcall

package
v2.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(fn func())

Call 安全地调用函数

func Go

func Go(fn func())

Go 执行单个协程

func GoWithDeadline

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

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

func GoWithTimeout

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

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

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