Documentation ¶
Index ¶
- type DefaultTheadEvent
- type PoolEvent
- type PoolManager
- func (this *PoolManager) AddErr(message string, threadName string)
- func (this *PoolManager) Cancel(message string)
- func (this *PoolManager) Ctx() context.Context
- func (this *PoolManager) ExecuteEvent(callback ThreadEvent)
- func (this *PoolManager) Init(durations ...time.Duration) *PoolManager
- func (this *PoolManager) IsCancel() bool
- func (this *PoolManager) Wait() error
- type ThreadEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultTheadEvent ¶
type DefaultTheadEvent struct {
PoolEvent PoolEvent
}
默认事件推荐器
func (*DefaultTheadEvent) SetPoolEvent ¶
func (this *DefaultTheadEvent) SetPoolEvent(poolEvent PoolEvent)
设置事件器 @param PoolEvent 事件器
type PoolEvent ¶
type PoolEvent interface { IsCancel() bool // 是否取消 Ctx() context.Context // 获取上下文 AddErr(message string, threadName string) // 设置错误 Cancel(message string) // 执行取消 }
线程事件
type PoolManager ¶
type PoolManager struct {
// contains filtered or unexported fields
}
线程池管理 @author fuzeyu
func (*PoolManager) AddErr ¶
func (this *PoolManager) AddErr(message string, threadName string)
添加一个错误 @param message 错误消息 @param threadName 线程名称
func (*PoolManager) ExecuteEvent ¶
func (this *PoolManager) ExecuteEvent(callback ThreadEvent)
执行一个事件 @param callback 事件回调方法
func (*PoolManager) Init ¶
func (this *PoolManager) Init(durations ...time.Duration) *PoolManager
初始化 @param seconds 工作时长
type ThreadEvent ¶
type ThreadEvent interface { SetPoolEvent(poolEvent PoolEvent) Execute() }
执行一个事件的方法
Click to show internal directories.
Click to hide internal directories.