task

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNew     = 0 //新建
	StatusRunning = 1 //运行中
	StatusEnd     = 2 //已完成
	StatusError   = 3 //错误
)

任务状态

Variables

View Source
var TaskInfos = &TaskMap{TaskInfos: make(map[int]wsTaskInfo.WsTaskInfo)}

Functions

This section is empty.

Types

type TaskInfo

type TaskInfo struct {
	Name     string
	Path     string
	Progress *model.StatusUpdate
	wsTaskInfo.WsTaskInfo
	// contains filtered or unexported fields
}

func (*TaskInfo) CloseBound

func (ti *TaskInfo) CloseBound()

func (*TaskInfo) CloseSockJSSession

func (ti *TaskInfo) CloseSockJSSession(reason string, status uint32)

func (*TaskInfo) GetBound

func (ti *TaskInfo) GetBound() chan error

func (*TaskInfo) GetId

func (ti *TaskInfo) GetId() int

func (*TaskInfo) IntoBound

func (ti *TaskInfo) IntoBound(msg error)

func (*TaskInfo) SendMsg

func (ti *TaskInfo) SendMsg(msg interface{})

func (*TaskInfo) SetBound

func (ti *TaskInfo) SetBound(c chan error)

func (*TaskInfo) SetId

func (ti *TaskInfo) SetId(id int)

func (*TaskInfo) SetSockJSSession

func (ti *TaskInfo) SetSockJSSession(s sockjs.Session)

type TaskMap

type TaskMap struct {
	TaskInfos map[int]wsTaskInfo.WsTaskInfo
	Lock      sync.Mutex
	wsTaskInfo.WsTask
}

func (*TaskMap) Close

func (ti *TaskMap) Close(id int, reason string, status uint32)

func (*TaskMap) Get

func (ti *TaskMap) Get(id int) wsTaskInfo.WsTaskInfo

func (*TaskMap) GetCount

func (ti *TaskMap) GetCount() int

GetCount 获取进行中任务数量

func (*TaskMap) Set

func (ti *TaskMap) Set(id int, task wsTaskInfo.WsTaskInfo)

Jump to

Keyboard shortcuts

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