Documentation ¶
Index ¶
- func AddPatrolTask(id interface{}, minInterval time.Duration, fn patrolcb, args ...interface{})
- type PatrolTask
- func (this *PatrolTask) AddTask(id interface{}, minInterval time.Duration, fn patrolcb, args ...interface{}) error
- func (this *PatrolTask) AddTaskOnce(id interface{}, fn patrolcb, args ...interface{}) error
- func (this *PatrolTask) AddTaskOnceA1(arg interface{}, fn func(arg interface{})) error
- func (this *PatrolTask) CheckAbnormal() error
- func (this *PatrolTask) CheckStart()
- func (this *PatrolTask) DelTask(id interface{}) error
- func (this *PatrolTask) Status() string
- type RunableProc
- type TaskPool
- type TaskWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPatrolTask ¶
Types ¶
type PatrolTask ¶
type PatrolTask struct {
// contains filtered or unexported fields
}
func DefaultPatrolTask ¶
func DefaultPatrolTask() *PatrolTask
func NewPatrolTask ¶
func NewPatrolTask() *PatrolTask
func (*PatrolTask) AddTask ¶
func (this *PatrolTask) AddTask(id interface{}, minInterval time.Duration, fn patrolcb, args ...interface{}) error
func (*PatrolTask) AddTaskOnce ¶
func (this *PatrolTask) AddTaskOnce(id interface{}, fn patrolcb, args ...interface{}) error
func (*PatrolTask) AddTaskOnceA1 ¶
func (this *PatrolTask) AddTaskOnceA1(arg interface{}, fn func(arg interface{})) error
func (*PatrolTask) CheckAbnormal ¶
func (this *PatrolTask) CheckAbnormal() error
func (*PatrolTask) CheckStart ¶
func (this *PatrolTask) CheckStart()
func (*PatrolTask) DelTask ¶
func (this *PatrolTask) DelTask(id interface{}) error
func (*PatrolTask) Status ¶
func (this *PatrolTask) Status() string
type RunableProc ¶
type RunableProc func(worker *TaskWorker, args ...interface{})
type TaskPool ¶
type TaskPool struct { TaskPush int64 TaskPop int64 WorkMin int32 // WorkMax int32 // BusyCnt int32 // 正在目录的线程 Terminated int32 // contains filtered or unexported fields }
func NewTaskPool ¶
func (*TaskPool) GetTaskNum ¶
func (*TaskPool) IsTerminated ¶
func (*TaskPool) PostTask ¶
func (this *TaskPool) PostTask(fn RunableProc, args ...interface{}) bool
func (*TaskPool) RunMinWorkers ¶
func (this *TaskPool) RunMinWorkers()
type TaskWorker ¶
func (*TaskWorker) Run ¶
func (this *TaskWorker) Run()
Click to show internal directories.
Click to hide internal directories.