Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWorkerPoolFull = errors.New("Job queue is full now, this Job will be droped")
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option 可选参数
func WithDropQueue ¶
func WithMaxQueueSize ¶
func WithMaxWorkersCount ¶
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool 协程池实现
func (*WorkerPool) Release ¶
func (wp *WorkerPool) Release()
func (*WorkerPool) Run ¶
func (wp *WorkerPool) Run(job Job) error
Run 通过协程池执行带处理任务 如果工作池满,返回ErrWorkerPoolFull错误,f将被丢弃,业务方可自行判断是否进行等待重试
Click to show internal directories.
Click to hide internal directories.