schedule

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultInterval

func GetDefaultInterval(interval time.Duration) time.Duration

GetDefaultInterval 获取默认的调度时长

func StartTask

func StartTask(taskName string, taskValues model.TaskValues, values map[interface{}]model.TaskValue)

StartTask 通过值来启动任务

Types

type ServiceEventHandler

type ServiceEventHandler struct {
	TaskValues model.TaskValues
}

ServiceEventHandler 服务上下线监听回调

func (*ServiceEventHandler) OnServiceAdded

func (s *ServiceEventHandler) OnServiceAdded(event *common.PluginEvent) error

OnServiceAdded 服务上线回调

func (*ServiceEventHandler) OnServiceDeleted

func (s *ServiceEventHandler) OnServiceDeleted(event *common.PluginEvent) error

OnServiceDeleted 服务下线回调

type TaskItem

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

TaskItem 任务包裹

type TaskRoutine

type TaskRoutine interface {
	// 进行任务调度
	Schedule() (chan<- *model.PriorityTask, model.TaskValues)
	// 结束协程
	Destroy()
}

TaskRoutine 任务调度协程接口

func NewTaskRoutine

func NewTaskRoutine(periodicTask *model.PeriodicTask) TaskRoutine

NewTaskRoutine 创建任务调度协程

Jump to

Keyboard shortcuts

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