private void scheduleSend(final int queueSize){
  if (pending) {
    return;
  }
  if (queueSize >= batchSize) {
    enqueueSend();
    return;
  }
  if (scheduled.compareAndSet(false,true)) {
    try {
      scheduler.schedule(null,maxLatencyMs,MILLISECONDS);
      schedulerQueueSize.incrementAndGet();
    }
 catch (    RejectedExecutionException ignore) {
    }
  }
}

private void scheduleSend ( final int queueSize ) { if ( pending ) { return ; } if ( queueSize >= batchSize ) { enqueueSend ( ) ; return ; } if ( scheduled . compareAndSet ( false , true ) ) { try { scheduler . schedule ( null , maxLatencyMs , MILLISECONDS ) ; schedulerQueueSize . incrementAndGet ( ) ; } catch ( RejectedExecutionException ignore ) { } } }
schedule this topic for future enqueuing for batch sending . if the batch size has been reached , enqueue for sending immediately .
