Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkStatusType ¶
type WorkStatusType int
const ( Created WorkStatusType = iota // 已创建 Prepared // 已就绪 Running // 运行中 Idle // 空闲中 Fault // 故障中 )
type Worker ¶
type Worker struct {
Id string // 唯一标识
Context context.Context // worker的上下文
JobCtx context.Context // 当前工作的上下文
Status WorkStatusType // 当前状态
Desc string // 描述
JobCh chan context.Context // 工作队列(输入)
OutCh chan string // 运行情况(日志)队列 (输出)
ResultCh chan model.RespModel // 运行结果(输出)
}
func (*Worker) CancelWork ¶
func (w *Worker) CancelWork()
func (*Worker) GetStatus ¶
func (w *Worker) GetStatus() WorkStatusType
Click to show internal directories.
Click to hide internal directories.