tasks

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EndTime string // 结束时间
View Source
var Ordercount int // 订单数
View Source
var Orderfailcount int // 失败订单数
View Source
var Sendcount int // 推送数
View Source
var StartTime string // 开始时间
View Source
var Usercount int // 用户数

Functions

func Add

func Add(taskModel models.Task) error

添加任务

func BatchAdd

func BatchAdd(tasks []models.Task)

批量添加任务

func Initialize

func Initialize()

初始化任务, 加载需要执行的定时任务, 添加到定时任务并运行

func NextRunTime

func NextRunTime(taskModel models.Task) time.Time

func Remove

func Remove(id int, taskLogId uint)

func RemoveAndAdd

func RemoveAndAdd(taskModel models.Task, taskLogId uint) error

删除任务后添加

func Run

func Run(taskModel models.Task)

直接运行任务

func Tracking

func Tracking(trackerId int, taskModel models.Task) error

基础追踪

func WaitAndExit

func WaitAndExit()

等待所有任务结束后退出

Types

type ConcurrencyQueue

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

并发队列

func (*ConcurrencyQueue) Add

func (cq *ConcurrencyQueue) Add()

func (*ConcurrencyQueue) Done

func (cq *ConcurrencyQueue) Done()

type HTTPGetHandler

type HTTPGetHandler struct{}

HTTP GET任务

func (*HTTPGetHandler) Run

func (h *HTTPGetHandler) Run(taskModel models.Task, taskUniqueId uint) error

type HTTPPostHandler

type HTTPPostHandler struct{}

HTTP POST任务

func (*HTTPPostHandler) Run

func (h *HTTPPostHandler) Run(taskModel models.Task, taskUniqueId uint) error

type Handler

type Handler interface {
	Run(taskModel models.Task, taskUniqueId uint) error
}

type Instance

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

任务ID作为Key

type TaskCount

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

任务计数

func (*TaskCount) Add

func (tc *TaskCount) Add()

func (*TaskCount) Done

func (tc *TaskCount) Done()

func (*TaskCount) Exit

func (tc *TaskCount) Exit()

func (*TaskCount) Wait

func (tc *TaskCount) Wait()

type TrackingHandler

type TrackingHandler struct{}

新添加的job 必须按照以下格式定义,并实现Run函数

func (*TrackingHandler) Run

func (t *TrackingHandler) Run(taskModel models.Task, taskUniqueId uint) error

Jump to

Keyboard shortcuts

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