timer

package
v0.0.0-...-70261f9 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Start = 1
	Stop  = 2
	Pause = 3
)

Variables

This section is empty.

Functions

func TestTask

func TestTask(t *testing.T)

Types

type Task

type Task struct {
	MaxRunCount int //最大运行数
	// contains filtered or unexported fields
}

type TaskQueue

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

循环队列,查询耳机险是否兑换

func NewTaskQueue

func NewTaskQueue() *TaskQueue

func (*TaskQueue) AddTask

func (q *TaskQueue) AddTask(task *Task)

func (*TaskQueue) Pause

func (q *TaskQueue) Pause()

func (*TaskQueue) RemoveTask

func (q *TaskQueue) RemoveTask(id int)

func (*TaskQueue) Start

func (q *TaskQueue) Start()

func (*TaskQueue) Stop

func (q *TaskQueue) Stop()

type Timer

type Timer interface {
	AddTaskByFunc(taskName string, spec string, task func(), option ...cron.Option) (cron.EntryID, error)
	AddTaskByJob(taskName string, spec string, job interface{ Run() }, option ...cron.Option) (cron.EntryID, error)
	FindCron(taskName string) (*cron.Cron, bool)
	StartTask(taskName string)
	StopTask(taskName string)
	Remove(taskName string, id int)
	Clear(taskName string)
	Close()
}

func NewTimerTask

func NewTimerTask() Timer

Jump to

Keyboard shortcuts

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