func (q *queue) Scan(ch chan<- queuePair) error {
	n := 0
	startKey, endKey := queueScanRange()
	iter := q.db.NewRangeIterator(startKey, endKey)
	defer iter.Release()

	for iter.Next() {
		var p queuePair
		if err := iter.Value(&p); err != nil {
			continue
		}
		p.key = iter.Key()
		if err := q.acquire(p); err != nil {
			return err
		}
		ch <- p
		n++
	}

	if n == 0 && q.numActive == 0 {
		return errors.New("EOF")
	}
	return nil
}
// Scan the pending queue and send items on 'ch'. Returns an error
// when the queue is empty (work is done).
Scan the pending queue and send items on 'ch'. Returns an error
when the queue is empty (work is done).
// Scan the pending queue and send items on ' ch ' . Returns an error // when the queue is empty ( work is done ) .
func (q *queue) Scan(ch chan<- queuePair) error {
	n := 0
	startKey, endKey := queueScanRange()
	iter := q.db.NewRangeIterator(startKey, endKey)
	defer iter.Release()
	for iter.Next() {
		var p queuePair
		if err := iter.Value(&p); err != nil {
			continue
		}
		p.key = iter.Key()
		if err := q.acquire(p); err != nil {
			return err
		}
		ch <- p
		n++
	}
	if n == 0 && q.numActive == 0 {
		return errors.New("EOF")
	}
	return nil
}
func ( q * queue ) Scan ( ch chan <- queuePair ) error { n := 0 startKey , endKey := queueScanRange ( ) iter := q . db . NewRangeIterator ( startKey , endKey ) defer iter . Release ( ) for iter . Next ( ) { var p queuePair if err := iter . Value ( & p ) ; err != nil { continue } p . key = iter . Key ( ) if err := q . acquire ( p ) ; err != nil { return err } ch <- p n ++ } if n == 0 && q . numActive == 0 { return errors . New ( " " ) } return nil }
Scan the pending queue and send items on 'ch'.
Scan the pending queue and send items on ' ch ' .