重构msg的包

This commit is contained in:
陈景阳
2019-09-10 09:32:48 +08:00
parent e5d33b8982
commit 9514a8a6af
14 changed files with 398 additions and 220 deletions

View File

@@ -0,0 +1,17 @@
package msg_handler
import (
"crawlab/constants"
"crawlab/utils"
)
type Task struct {
msg NodeMessage
}
func (t *Task) Handle() error {
// 取消任务
ch := utils.TaskExecChanMap.ChanBlocked(t.msg.TaskId)
ch <- constants.TaskCancel
return nil
}