@Override public long getTimeToFirstByteMillis() { return nettyConnection.getTimeToFirstByteMillis(); }
@Override public boolean returnConnection(Connection connection) { stats.recordTimeToFirstByte(connection.getTimeToFirstByteMillis()); if (connection.isConnected()) { Subscriber<? super Connection> subscriber = waitingSubscribers.poll(); if (subscriber != null) { subscriber.onNext(connection); subscriber.onCompleted(); } else { // todo this synchronization can probably be removed synchronized (connection) { busyConnections.decrementAndGet(); borrowedConnections.remove(connection); availableConnections.add(connection); } } } else { connectionClosedInternal(connection); } return false; }