Documentation ¶
Index ¶
- func CheckInitialDefaultWorkers(minwork, maxwork int32, quemax int32) bool
- type GroupTask
- func (this *GroupTask) CheckAbnormal() (err error)
- func (this *GroupTask) CheckCreateFixedGroupChannel(groupid interface{}) *groupTaskChannel
- func (this *GroupTask) ConfigChannelMaxQueueSize(queue_size int32) *GroupTask
- func (this *GroupTask) ConfigChannelMaxWorkNum(groupid interface{}, maxWorkNum int32) *GroupTask
- func (this *GroupTask) ConfigGrowIfTaskPiled(num int32) *GroupTask
- func (this *GroupTask) ConfigMaxWork(num int32) *GroupTask
- func (this *GroupTask) ConfigMinWork(num int32) *GroupTask
- func (this *GroupTask) ConfigPostTimeout(v time.Duration)
- func (this *GroupTask) Details(all bool) string
- func (this *GroupTask) DetailsEx(all bool, max int) string
- func (this *GroupTask) DetailsEx2(all bool, max int, searchval, exclusive string) string
- func (this *GroupTask) GetChannelMaxQueueSize() int32
- func (this *GroupTask) GroupSimpleStatus(groupid interface{}) string
- func (this *GroupTask) GroupStatus(groupid interface{}) string
- func (this *GroupTask) IsTerminated() bool
- func (this *GroupTask) PostChannelTaskFunc(groupChanel interface{}, cb func(args ...interface{}), args ...interface{}) error
- func (this *GroupTask) PostTaskArgs(groupid interface{}, cb func(sender *groupTaskRec), args ...interface{}) error
- func (this *GroupTask) PostTaskArgsEx(groupid interface{}, cb func(args ...interface{}), args ...interface{}) error
- func (this *GroupTask) PostTaskFunc(groupid interface{}, cb func()) error
- func (this *GroupTask) PostTaskFuncAndWait(groupid interface{}, timeout time.Duration, cb func()) (ok bool, err error)
- func (this *GroupTask) PostTaskFuncArgs(groupid interface{}, cb func(args ...interface{}), args ...interface{}) error
- func (this *GroupTask) RemoveFixedGroupChannel(groupid interface{}) bool
- func (this *GroupTask) Start()
- func (this *GroupTask) StatusSimpleString() string
- func (this *GroupTask) StatusString() string
- func (this *GroupTask) Stop()
- func (this *GroupTask) TaskCnt() int32
- func (this *GroupTask) Terminate()
- func (this *GroupTask) WaitExecFunc(sender *groupTaskRec)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GroupTask ¶
type GroupTask struct { Id string FixedWorker byte OnFatalCallBack func(sender *GroupTask, rec *groupTaskRec, err error) // contains filtered or unexported fields }
func DefaultGroupTask ¶
func DefaultGroupTask() *GroupTask
func NewGroupTask ¶
func NewGroupTask() *GroupTask
func (*GroupTask) CheckAbnormal ¶
func (*GroupTask) CheckCreateFixedGroupChannel ¶
func (this *GroupTask) CheckCreateFixedGroupChannel(groupid interface{}) *groupTaskChannel
func (*GroupTask) ConfigChannelMaxQueueSize ¶
func (*GroupTask) ConfigGrowIfTaskPiled ¶
func (*GroupTask) ConfigMaxWork ¶
func (*GroupTask) ConfigMinWork ¶
func (*GroupTask) ConfigPostTimeout ¶ added in v1.2.24041
func (*GroupTask) DetailsEx2 ¶
func (*GroupTask) GetChannelMaxQueueSize ¶
func (*GroupTask) GroupSimpleStatus ¶
func (*GroupTask) GroupStatus ¶
func (*GroupTask) IsTerminated ¶
func (*GroupTask) PostChannelTaskFunc ¶
func (this *GroupTask) PostChannelTaskFunc(groupChanel interface{}, cb func(args ...interface{}), args ...interface{}) error
需要调用者确保groupChannel可用 没有被移除掉
func (*GroupTask) PostTaskArgs ¶
func (*GroupTask) PostTaskArgsEx ¶
func (*GroupTask) PostTaskFunc ¶
func (*GroupTask) PostTaskFuncAndWait ¶
func (this *GroupTask) PostTaskFuncAndWait(groupid interface{}, timeout time.Duration, cb func()) (ok bool, err error)
参数:
timeout:表示等待执行的时间, 如果到时尚未执行, 则函数不会再执行, 如果到超时时间已经在执行,则会等待执行完成
返回:
ok: true: 表示执行成功, false:执行超时 err: 投递任务失败, wait timeout
func (*GroupTask) PostTaskFuncArgs ¶
func (this *GroupTask) PostTaskFuncArgs(groupid interface{}, cb func(args ...interface{}), args ...interface{}) error
**
- 可以用做同步执行
func (*GroupTask) RemoveFixedGroupChannel ¶
func (*GroupTask) StatusSimpleString ¶
func (*GroupTask) StatusString ¶
func (*GroupTask) WaitExecFunc ¶
func (this *GroupTask) WaitExecFunc(sender *groupTaskRec)
Click to show internal directories.
Click to hide internal directories.