private void handlePiggyback(SessionProtocol desiredProtocol,
                                     SerializationFormat serializationFormat,
                                     PoolKey key,
                                     ChannelAcquisitionFuture childPromise,
                                     ClientConnectionTimingsBuilder timingsBuilder,
                                     @Nullable PooledChannel pch) {

            final PiggybackedChannelAcquisitionResult result;
            if (pch != null) {
                final SessionProtocol actualProtocol = pch.protocol();
                if (actualProtocol.isMultiplex()) {
                    final HttpSession session = HttpSession.get(pch.get());
                    if (session.incrementNumUnfinishedResponses()) {
                        result = PiggybackedChannelAcquisitionResult.SUCCESS;
                        // Should use the same protocol used to acquire a new connection.
                    } else if (usePendingAcquisition(desiredProtocol, serializationFormat,
                                                     key, childPromise, timingsBuilder)) {
                        result = PiggybackedChannelAcquisitionResult.PIGGYBACKED_AGAIN;
                    } else {
                        result = PiggybackedChannelAcquisitionResult.NEW_CONNECTION;
                    }
                } else {
                    // Try to acquire again because the connection was not HTTP/2.
                    // We use the exact protocol (H1 or H1C) instead of 'desiredProtocol' so that
                    // we do not waste our time looking for pending acquisitions for the host
                    // that does not support HTTP/2.
                    final PooledChannel ch = acquireNow(actualProtocol, serializationFormat, key);
                    if (ch != null) {
                        pch = ch;
                        result = PiggybackedChannelAcquisitionResult.SUCCESS;
                    } else {
                        result = PiggybackedChannelAcquisitionResult.NEW_CONNECTION;
                    }
                }
            } else {
                result = PiggybackedChannelAcquisitionResult.NEW_CONNECTION;
            }

            switch (result) {
                case SUCCESS:
                    assert pch != null;
                    timingsBuilder.pendingAcquisitionEnd();
                    childPromise.complete(pch);
                    break;
                case NEW_CONNECTION:
                    timingsBuilder.pendingAcquisitionEnd();
                    connect(desiredProtocol, serializationFormat, key, childPromise, timingsBuilder);
                    break;
                case PIGGYBACKED_AGAIN:
                    // There's nothing to do because usePendingAcquisition() was called successfully above.
                    break;
            }
        }
A {@code Consumer<PooledChannel>} if only 1 handler.
A {@code List<Consumer<PooledChannel>>} if there are 2+ handlers.
core/src/main/java/com/linecorp/armeria/client/HttpChannelPool.java