private boolean tryQueueCurrentBuffer(long elapsedWaiting){
  if (currentBuffer.isEmpty())   return true;
  if (isOpen && neverPubQueue.size() < neverPubCapacity) {
    neverPubQueue.add(currentBuffer);
    totalQueuedRecords.addAndGet(currentBuffer.sizeRecords());
    totalQueuedBuffers.incrementAndGet();
    onQueueBufferSuccess(currentBuffer,elapsedWaiting);
    currentBuffer=new RecordBuffer<>(flow);
    return true;
  }
 else   if (elapsedWaiting > 0) {
    onQueueBufferTimeout(currentBuffer,elapsedWaiting);
    return false;
  }
 else   return false;
}

private boolean tryQueueCurrentBuffer ( long elapsedWaiting ) { if ( currentBuffer . isEmpty ( ) ) return true ; if ( isOpen && neverPubQueue . size ( ) < neverPubCapacity ) { neverPubQueue . add ( currentBuffer ) ; totalQueuedRecords . addAndGet ( currentBuffer . sizeRecords ( ) ) ; totalQueuedBuffers . incrementAndGet ( ) ; onQueueBufferSuccess ( currentBuffer , elapsedWaiting ) ; currentBuffer = new RecordBuffer < > ( flow ) ; return true ; } else if ( elapsedWaiting > 0 ) { onQueueBufferTimeout ( currentBuffer , elapsedWaiting ) ; return false ; } else return false ; }
keep private . call only when holding lock .
