task

package
v0.0.0-...-4365a35 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskList map[int]Task

Functions

func Add

func Add(timev int64, taskType int, taskVaule string) int

func Del

func Del(id int) bool

func Init

func Init()

func Len

func Len() int

func Run

func Run()

Types

type Task

type Task struct {
	Id          int    //任务id
	Time        int64  //任务执行时间或者时间间隔
	TaskType    int    //任务的类型
	TaskVaule   string //任务
	NextRunTime int64  //下次运行时间
	Lock        sync.Mutex
}

func GetTask

func GetTask(id int) (Task, bool)

func (*Task) Do

func (this *Task) Do() Task

func (*Task) Update

func (this *Task) Update()

Jump to

Keyboard shortcuts

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