本文整理匯總了Golang中github.com/nutrun/lentil.Beanstalkd.ListTubes方法的典型用法代碼示例。如果您正苦於以下問題:Golang Beanstalkd.ListTubes方法的具體用法?Golang Beanstalkd.ListTubes怎麽用?Golang Beanstalkd.ListTubes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/nutrun/lentil.Beanstalkd
的用法示例。
在下文中一共展示了Beanstalkd.ListTubes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: queryTubes
func queryTubes(q *lentil.Beanstalkd) (map[string]*Tube, error) {
tubes := make(map[string]*Tube)
names, e := q.ListTubes()
if e != nil {
return nil, e
}
for _, tube := range names {
if tube == "default" {
continue
}
tubestats, e := q.StatsTube(tube)
if e != nil {
continue
}
ready, _ := strconv.Atoi(tubestats["current-jobs-ready"])
reserved, _ := strconv.Atoi(tubestats["current-jobs-reserved"])
delayed, _ := strconv.Atoi(tubestats["current-jobs-delayed"])
pause, _ := strconv.Atoi(tubestats["pause"])
tubes[tube] = NewTube(tube, uint(reserved), uint(ready), uint(delayed), uint(pause))
}
return tubes, nil
}