Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler interface {
// 添加工作到线程池队列中
// 如果队列已满,则返回失败
Add(job Job) bool
// 添加任务到线程池队列中
// 当队列容量已满时:
// 有界队列, 超过队列容量时新工作入队直接失败
// 无界队列, 新工作入队时一直等待直到入队成功
Join(t Task, args ...interface{}) bool
// contains filtered or unexported methods
}
调度器接口
func NewBlocking ¶
创建新的线程池队列调度器 workerNum: 并发工作数量
Click to show internal directories.
Click to hide internal directories.