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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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