xcall

package
v2.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(fn func())

Call 安全地调用函数

func Go added in v2.1.0

func Go(fn func())

Go 执行单个协程

func GoWithDeadline added in v2.2.3

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

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

func GoWithTimeout added in v2.2.3

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

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

Types

type Goroutines added in v2.2.3

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

func NewGoroutines added in v2.2.3

func NewGoroutines() *Goroutines

func (*Goroutines) Add added in v2.2.3

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

Add 添加协程函数

func (*Goroutines) Run added in v2.2.3

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