/** * This method will block if the async write queue is currently larger * than the configured maximum. The amount of time that this method * will block is dependent on the write timeout of the transport * associated with the specified connection. */ private static void blockUntilQueueFree(final Connection c) { if (!c.canWrite()) { final FutureImpl<Boolean> future = Futures.createSafeFuture(); // Connection may be obtained by calling FilterChainContext.getConnection(). c.notifyCanWrite(new WriteHandler() { @Override public void onWritePossible() throws Exception { future.result(TRUE); } @Override public void onError(Throwable t) { future.failure(makeIOException(t)); } }); block(c, future); } }
/** * This method will block if the async write queue is currently larger * than the configured maximum. The amount of time that this method * will block is dependent on the write timeout of the transport * associated with the specified connection. */ private static void blockUntilQueueFree(final Connection c) { if (!c.canWrite()) { final FutureImpl<Boolean> future = Futures.createSafeFuture(); // Connection may be obtained by calling FilterChainContext.getConnection(). c.notifyCanWrite(new WriteHandler() { @Override public void onWritePossible() throws Exception { future.result(TRUE); } @Override public void onError(Throwable t) { future.failure(makeIOException(t)); } }); block(c, future); } }
/** * This method will block if the async write queue is currently larger * than the configured maximum. The amount of time that this method * will block is dependent on the write timeout of the transport * associated with the specified connection. */ private static void blockUntilQueueFree(final Connection c) { if (!c.canWrite()) { final FutureImpl<Boolean> future = Futures.createSafeFuture(); // Connection may be obtained by calling FilterChainContext.getConnection(). c.notifyCanWrite(new WriteHandler() { @Override public void onWritePossible() throws Exception { future.result(TRUE); } @Override public void onError(Throwable t) { future.failure(makeIOException(t)); } }); block(c, future); } }
/** * This method will block if the async write queue is currently larger * than the configured maximum. The amount of time that this method * will block is dependent on the write timeout of the transport * associated with the specified connection. */ private static void blockUntilQueueFree(final Connection c) { if (!c.canWrite()) { final FutureImpl<Boolean> future = Futures.createSafeFuture(); // Connection may be obtained by calling FilterChainContext.getConnection(). c.notifyCanWrite(new WriteHandler() { @Override public void onWritePossible() throws Exception { future.result(TRUE); } @Override public void onError(Throwable t) { future.failure(makeIOException(t)); } }); block(c, future); } }