示例#1
0
// CloseAllQueues closes all queues
func (repo *QueueRepository) CloseAllQueues() error {
	var err error
	var q *queue.Queue
	for pair := range repo.storage.IterBuffered() {
		q, err = repo.GetQueue(pair.Key)
		if err != nil {
			return err
		}
		q.Close()
	}
	return nil
}
示例#2
0
func (self *QueueRepository) CloseAllQueues() error {
	var err error
	var q *queue.Queue
	for pair := range self.storage.Iter() {
		q, err = self.GetQueue(pair.Key)
		if err != nil {
			return err
		}
		q.Close()
	}
	return nil
}