task

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 7 Imported by: 0

README

eventloop

任务循环,RunLoop实现

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleTaskFunc

type HandleTaskFunc func(itask.ITask) error

type TaskMgr

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

func NewTaskMgr

func NewTaskMgr(task_serialize itask.ITaskSerialize, fn HandleTaskFunc, opts ...*options.MgrOptions) *TaskMgr

concurrenceNum:任务最大并发数量,数量必须大于强制顺序顺序类型的数量多,否则并发数有可能被其全部占用,而普通任务无法执行 sleep_deltas:任务处理错误的增量 task_serialize: 任务的管理,序列化、反序列化、hasnext,next等 fn:具体任务的处理逻辑

func (*TaskMgr) Add

func (this *TaskMgr) Add(task itask.ITask) error

添加任务

func (*TaskMgr) Start

func (this *TaskMgr) Start()

func (*TaskMgr) Stop

func (this *TaskMgr) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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