workpool

package
v0.0.0-...-0286adb Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXECUTOR_NEW             = iota // executor新建
	EXECUTOR_START                  // executor初始化
	EXECUTOR_END                    // executor结束
	EXECUTOR_TASK_BEGIN             // 对应的executor增加一个协程
	EXECUTOR_TASK_SUCCESS           // 对应的executor减少一个协程
	EXECUTOR_TASK_FAILED            // 对应的executor减少一个协程
	EXECUTOR_CHANNEL_TO_POOL        // executor中的channel放回pool

	DISPATCH_INIT
	DISPATCH_INIT_OVER
	DISPATCH_INIT_RUN
	DISPATCH_INIT_RUN_OVER
	DISPATCH_RECEIVE_TASK
	DISPATCH_POP_TASK
	DISPATCH_POP_CHANNEL
	DISPATCH_END
)

Variables

This section is empty.

Functions

func AddTask

func AddTask(task func(p ...interface{}), p ...interface{}) bool

添加任务到dispatch

func Close

func Close()

func Initialize

func Initialize(queueLength, maxCount int)

func SendTaskLog

func SendTaskLog(did, taskId string, cnt, currTaskCnt, logType, currRoutineCnt int, currentTime time.Time)

发送task日志

Types

type Dispatcher

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

type TaskFunc

type TaskFunc func(p ...interface{})

任务的方法体

Jump to

Keyboard shortcuts

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