@Override public void operationComplete(Future<Object> future) throws Exception { // Inefficient, but works. if (isTerminated()) { terminationFuture.trySuccess(null); } } };
@Override public void operationComplete(Future<Object> future) throws Exception { // Inefficient, but works. if (isTerminated()) { terminationFuture.trySuccess(null); } } };
@Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long deadline = System.nanoTime() + unit.toNanos(timeout); for (EventLoop l: activeChildren) { for (;;) { long timeLeft = deadline - System.nanoTime(); if (timeLeft <= 0) { return isTerminated(); } if (l.awaitTermination(timeLeft, TimeUnit.NANOSECONDS)) { break; } } } for (EventLoop l: idleChildren) { for (;;) { long timeLeft = deadline - System.nanoTime(); if (timeLeft <= 0) { return isTerminated(); } if (l.awaitTermination(timeLeft, TimeUnit.NANOSECONDS)) { break; } } } return isTerminated(); }
@Override public void operationComplete(Future<Object> future) throws Exception { // Inefficient, but works. if (isTerminated()) { terminationFuture.trySuccess(null); } } };
@Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long deadline = System.nanoTime() + unit.toNanos(timeout); for (EventLoop l: activeChildren) { for (;;) { long timeLeft = deadline - System.nanoTime(); if (timeLeft <= 0) { return isTerminated(); } if (l.awaitTermination(timeLeft, TimeUnit.NANOSECONDS)) { break; } } } for (EventLoop l: idleChildren) { for (;;) { long timeLeft = deadline - System.nanoTime(); if (timeLeft <= 0) { return isTerminated(); } if (l.awaitTermination(timeLeft, TimeUnit.NANOSECONDS)) { break; } } } return isTerminated(); }
@Override @Deprecated public void shutdown() { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdown(); } for (EventLoop l: idleChildren) { l.shutdown(); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } }
@Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long deadline = System.nanoTime() + unit.toNanos(timeout); for (EventLoop l: activeChildren) { for (;;) { long timeLeft = deadline - System.nanoTime(); if (timeLeft <= 0) { return isTerminated(); } if (l.awaitTermination(timeLeft, TimeUnit.NANOSECONDS)) { break; } } } for (EventLoop l: idleChildren) { for (;;) { long timeLeft = deadline - System.nanoTime(); if (timeLeft <= 0) { return isTerminated(); } if (l.awaitTermination(timeLeft, TimeUnit.NANOSECONDS)) { break; } } } return isTerminated(); }
@Override @Deprecated public void shutdown() { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdown(); } for (EventLoop l: idleChildren) { l.shutdown(); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } }
@Override @Deprecated public void shutdown() { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdown(); } for (EventLoop l: idleChildren) { l.shutdown(); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } }
@Override public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } for (EventLoop l: idleChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } return terminationFuture(); }
@Override public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } for (EventLoop l: idleChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } return terminationFuture(); }
@Override public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } for (EventLoop l: idleChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } return terminationFuture(); }
@Override public void operationComplete(Future<Object> future) throws Exception { // Inefficient, but works. if (isTerminated()) { terminationFuture.trySuccess(null); } } };
@Override public void operationComplete(Future<Object> future) throws Exception { // Inefficient, but works. if (isTerminated()) { terminationFuture.trySuccess(null); } } };
@Override public void operationComplete(Future<Object> future) throws Exception { // Inefficient, but works. if (isTerminated()) { terminationFuture.trySuccess(null); } } };
@Override @Deprecated public void shutdown() { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdown(); } for (EventLoop l: idleChildren) { l.shutdown(); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } }
@Override @Deprecated public void shutdown() { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdown(); } for (EventLoop l: idleChildren) { l.shutdown(); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } }
@Override @Deprecated public void shutdown() { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdown(); } for (EventLoop l: idleChildren) { l.shutdown(); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } }
@Override public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } for (EventLoop l: idleChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } return terminationFuture(); }
@Override public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) { shuttingDown = true; for (EventLoop l: activeChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } for (EventLoop l: idleChildren) { l.shutdownGracefully(quietPeriod, timeout, unit); } // Notify the future if there was no children. if (isTerminated()) { terminationFuture.trySuccess(null); } return terminationFuture(); }