task

package
v0.0.0-...-828062d Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReStartAllTask

func ReStartAllTask()

func RegisterTask

func RegisterTask(task *TaskInfo)

func RemoveTask

func RemoveTask(taskName string)

func StartAllTask

func StartAllTask()

开启所有Task执行

func StopAllTask

func StopAllTask()

结束所有Task

Types

type TaskHandler

type TaskHandler func(*TaskInfo)

type TaskInfo

type TaskInfo struct {
	Name string
	//创建Task时,可通过该属性传递需要定制的信息
	TaskData interface{}
	// contains filtered or unexported fields
}

task info

func NewTask

func NewTask(name string, handler TaskHandler) *TaskInfo

传入Name创建Taskinfo

func (*TaskInfo) Start

func (t *TaskInfo) Start()

启动指定Task执行

func (*TaskInfo) Stop

func (t *TaskInfo) Stop()

停止指定Task执行

Jump to

Keyboard shortcuts

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