示例#1
0
文件: load.go 项目: jbli/redismq
func read(queue *redismq.Queue, prefix string) {
	consumer, err := queue.AddConsumer("testconsumer" + prefix)
	if err != nil {
		panic(err)
	}
	consumer.ResetWorking()
	for {
		p, err := consumer.Get()
		if err != nil {
			log.Println(err)
			continue
		}
		err = p.Ack()
	}
}
示例#2
0
文件: load.go 项目: jbli/redismq
func write(queue *redismq.Queue) {
	payload := randomString(1024 * 1) //adjust for size
	for {
		queue.Put(payload)
	}
}