Documentation ¶
Index ¶
- Constants
- Variables
- type Priority
- type Statistic
- type Task
- type TaskQueue
- func (q *TaskQueue) Close()
- func (q *TaskQueue) GetStatistic() *Statistic
- func (q *TaskQueue) Pop2do() (*Task, error)
- func (q *TaskQueue) PopDone() (*Task, error)
- func (q *TaskQueue) Push2doWait(priority Priority, execTimeout time.Duration, dataPtr interface{})
- func (q *TaskQueue) PushDone(id string, err error)
Constants ¶
View Source
const (
PriorityCount int = 5
)
Variables ¶
View Source
var (
ErrorExecTimeout error = errors.Errorf("Exec timeout")
)
Functions ¶
This section is empty.
Types ¶
type Statistic ¶
type Statistic struct { // 此刻排队任务个数 Now2doSize int64 // 此刻正在执行的任务个数 NowExecSize int64 // 近期的开始时间 LatelyStatisticBeginTime time.Time // 近期任务成功次数 LatelySuccessSize int64 // 近期等待执行超时次数 //LatelyWaitTimeoutSize int64 // 近期执行超时次数 LatelyExecTimeoutSize int64 // 近期执行出错次数 LatelyExecErrorSize int64 // 近期执行平均耗时 LatelyAvgExecDuration time.Duration }
type TaskQueue ¶
type TaskQueue struct {
// contains filtered or unexported fields
}
func (*TaskQueue) GetStatistic ¶
func (*TaskQueue) Push2doWait ¶
Wait until pushed.
Click to show internal directories.
Click to hide internal directories.