github.com/weedge/lib@v0.0.0-20230424045628-a36dcc1d90e4/pool/workerpool/task.go (about)

     1  package workerpool
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  type Task struct {
     8  	Do          func(inParam interface{}, outParam interface{}) bool //返回值主要来知道是否执行完
     9  	InParam     interface{}                                          //输入
    10  	OutParam    interface{}                                          //输出
    11  	ChIsTimeOut chan<- bool                                          //是否超时,true 超时,false 正常
    12  	TimeOut     time.Duration                                        //任务超时时间
    13  	OnTimeOut   func(inParam interface{}, outParam interface{})
    14  }