Task

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCronTask

func GetCronTask() *cron.Cron

初始化定时任务器

func Task

func Task(f TaskFunc, cb func(), params ...interface{})

func TaskMustBefore

func TaskMustBefore(job func(in InChan), d time.Duration) (interface{}, error)

Types

type InChan

type InChan chan interface{}

type SetInterVal

type SetInterVal struct {
}
var CronInstance *SetInterVal

func New

func New() *SetInterVal

func (*SetInterVal) Do

func (this *SetInterVal) Do(cron string, exprorfunc interface{}) *SetInterVal

type TaskExecutor

type TaskExecutor struct {
	// contains filtered or unexported fields
}

func NewTaskExecutor

func NewTaskExecutor(f TaskFunc, p []interface{}, callback func()) *TaskExecutor

辅助函数 初始化任务器

func (*TaskExecutor) Exec

func (this *TaskExecutor) Exec()

type TaskFunc

type TaskFunc func(params ...interface{})

type TaskLmit

type TaskLmit struct {
	// contains filtered or unexported fields
}

func LimtTask

func LimtTask(maxNum int) *TaskLmit

控制任务数

func (*TaskLmit) CanDo

func (this *TaskLmit) CanDo()

func (*TaskLmit) Close

func (this *TaskLmit) Close()

Jump to

Keyboard shortcuts

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