@Override public boolean await(final long timeout, final TimeUnit timeUnit) throws IllegalStateException, InterruptedException { if(isShutdown()) { final long invokeTimeMillis = System.currentTimeMillis(); final long timeOutMillis = timeUnit.toMillis(timeout); while(timeOutMillis > System.currentTimeMillis() - invokeTimeMillis) { if(itemsBuff.isEmpty()) { return true; } LockSupport.parkNanos(1); } return false; } else { return super.await(timeout, timeUnit); } }
try { if(isStarted()) { input.get(itemsBuff, capacity - itemsBuff.size()); } catch(final EOFException e) { try { close(); } catch(final IOException ee) { LOG.log(Level.WARNING, "Failed to close self after EOF", ee); if(cause instanceof EOFException) { try { close(); } catch(final IOException ee) { LOG.log(Level.WARNING, "Failed to close self after EOF", ee);
new TransferFiber<>(ServiceTaskExecutor.INSTANCE, driver, this, batchSize); final long configCountLimit = opLimitConfig.longVal("count"); this.countLimit = configCountLimit > 0 ? configCountLimit : Long.MAX_VALUE;