private void sendPending(){
  while (outstanding.get() < concurrency) {
    final TopicQueue queue=pendingTopics.poll();
    if (queue == null) {
      return;
    }
    queue.pending=false;
    final int sent=queue.sendBatch();
    if (sent == batchSize) {
      queue.pending=true;
      pendingTopics.offer(queue);
    }
  }
}

private void sendPending ( ) { while ( outstanding . get ( ) < concurrency ) { final TopicQueue queue = pendingTopics . poll ( ) ; if ( queue == null ) { return ; } queue . pending = false ; final int sent = queue . sendBatch ( ) ; if ( sent == batchSize ) { queue . pending = true ; pendingTopics . offer ( queue ) ; } } }
send any pending topics .
