goroutine

package
v0.0.0-...-ed6a5cb Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafeGo

func SafeGo(ctx context.Context, handler func())

SafeGo 进行安全的goroutine调用 第一个参数是context接口,如果还实现了Container接口,且绑定了日志服务,则使用日志服务 第二个参数是匿名函数handler, 进行最终的业务逻辑 SafeGo 函数并不会返回error,panic都会进入colon的日志服务

func SafeGoAndWait

func SafeGoAndWait(ctx context.Context, handlers ...func() error) error

SafeGoAndWait 进行并发安全并行调用 第一个参数是context接口,如果还实现了Container接口,且绑定了日志服务,则使用日志服务 第二个参数是匿名函数handlers数组, 进行最终的业务逻辑 返回handlers中任何一个错误(如果handlers中有业务逻辑返回错误)

Types

This section is empty.

Jump to

Keyboard shortcuts

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