hctx

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoManyTask

type DoManyTask struct {
	Count   int           // 任务数
	Timeout time.Duration // 超时时间
	Debug   bool          // 开启调试模式
}

DoManyTask 多任务结构体

func (*DoManyTask) DoTaskSuccessOne

func (do *DoManyTask) DoTaskSuccessOne(params interface{}, doBizFun func(do *DoManyTask, ctx context.Context, channel chan interface{}, wg *sync.WaitGroup, index int, params interface{})) (interface{}, error)

DoTaskSuccessOne 并发执行任务,成功一次即返回

func (*DoManyTask) WaitDataReturn

func (do *DoManyTask) WaitDataReturn(isNeedReturn bool, ctx context.Context, channel chan interface{}, wg *sync.WaitGroup, index int, data interface{})

WaitDataReturn 获取返回数据,自定义回调函数中必须执行此方法,以获取返回值

Jump to

Keyboard shortcuts

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