schedule

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryNum  = 3 // 失败重试次数
	RetryWait = 1 // 失败重试等待时间,秒
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTaskOptions added in v0.7.1

type AddTaskOptions struct {
	Name     string
	StartRun bool
	Params   []interface{}
	Task     api.Task
}

type Options added in v0.6.5

type Options struct {
	WG *sync.WaitGroup
}

type Schedule

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

func NewSchedule

func NewSchedule(opts *Options) *Schedule

func (*Schedule) Add

func (s *Schedule) Add(opts *AddTaskOptions)

func (*Schedule) Delete

func (s *Schedule) Delete(name string)

func (*Schedule) Get added in v0.7.1

func (s *Schedule) Get(name string) *TaskInfo

func (*Schedule) List

func (s *Schedule) List() []*TaskInfo

func (*Schedule) Start

func (s *Schedule) Start(ctx context.Context)

type TaskInfo

type TaskInfo struct {
	Name    string
	Task    api.Task
	Params  []interface{}
	TaskRun func(params ...interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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