taskrunner

package
v0.0.0-...-1f55c80 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReadyToDispatch controlChan中的消息 下发任务
	ReadyToDispatch = "d"
	// ReadyToExecute controlChan中的消息 执行任务
	ReadyToExecute = "e"
	// CLOSE controlChan中的消息 关闭消息
	CLOSE = "c"
)

Variables

This section is empty.

Functions

func Start

func Start()

Start 开始任务

func VideoClearDispatcher

func VideoClearDispatcher(dc dataChan) error

VideoClearDispatcher 删除视频的任务分发方法

func VideoClearExecutor

func VideoClearExecutor(dc dataChan) error

VideoClearExecutor 执行删除视频的方法

Types

type Runner

type Runner struct {
	Controller controlChan
	Error      controlChan
	Data       dataChan

	Dispatcher fn
	Executor   fn
	// contains filtered or unexported fields
}

Runner 任务运行类

func NewRunner

func NewRunner(size int, longLived bool, d fn, e fn) *Runner

NewRunner 初始化一个Runner

func (*Runner) StartAll

func (r *Runner) StartAll()

StartAll 开始所有任务

type Worker

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

Worker 定时任务类

func NewWorker

func NewWorker(interval time.Duration, r *Runner) *Worker

NewWorker Worker的构造函数

Jump to

Keyboard shortcuts

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