task

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTask

func RegisterTask(name string, taskNums int, call DoFunc)

RegisterTask

func Start

func Start()

Start start task

func StartAndWait

func StartAndWait()

StartAndWait start and wait all task done

func Stop

func Stop()

Stop stop task

func Wait

func Wait()

Wait wait all task done

Types

type Context

type Context struct {
	Name   string `json:"name"`
	TaskNo int    `json:"taskNo"`
	Done   bool   `json:"done"`
	// contains filtered or unexported fields
}

Context 任务上下文对象

func NewContext

func NewContext() *Context

NewContext

func (*Context) IsDone

func (c *Context) IsDone() bool

IsDone

func (*Context) SetDone

func (c *Context) SetDone(d bool)

SetDone

type DoFunc

type DoFunc func(*Context)

DoFunc

Jump to

Keyboard shortcuts

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