Example #1
0
func NewQueue(goenv *goenv.Goenv, name string) *Queue {
	q := &Queue{Name: name}
	host, port, db := goenv.GetRedis()
	q.redisClient = redis.NewTCPClient(host+":"+port, "", int64(db))
	q.redisClient.SAdd(MasterQueueKey(), name)
	return q
}
Example #2
0
//TODO Test this?
func NewOverseer(goenv *goenv.Goenv) *Overseer {
	q := &Overseer{goenv: goenv, Stats: make(map[string]*QueueStat)}
	host, port, db := goenv.GetRedis()
	q.redisClient = redis.NewTCPClient(host+":"+port, "", int64(db))

	for _, queue := range q.GetAllQueues() {
		q.WatchQueue(queue)
	}
	return q
}