code: func (q *queue) countProcessableItems() int {
  	for i, result := range q.resultCache {
  		if result == nil || result.Pending > 0 {
  			return i
  		}
  	}
  	return len(q.resultCache)
  }
docs: // countProcessableItems counts the processable items.