@Override
    public void invoke(PooledChannel pooledChannel, ClientRequestContext ctx,
                       HttpRequest req, DecodedHttpResponse res) {
        applyOutlierDetection(ctx);
        if (handleEarlyCancellation(ctx, req, res)) {
            pooledChannel.release();
            return;
        }

        final long writeTimeoutMillis = ctx.writeTimeoutMillis();

        assert protocol != null;
        assert requestEncoder != null;
        assert responseDecoder != null;
        if (!protocol.isMultiplex() && !serializationFormat.requiresNewConnection(protocol)) {
            // When HTTP/1.1 is used and the serialization format does not require
            // a new connection (w.g. WebSocket):
            // If pipelining is enabled, return as soon as the request is fully sent.
            // If pipelining is disabled,
            // return after the response is fully received and the request is fully sent.
            final boolean useHttp1Pipelining = clientFactory.useHttp1Pipelining();
            final CompletableFuture<Void> completionFuture =
                    useHttp1Pipelining ? req.whenComplete()
                                       : CompletableFuture.allOf(req.whenComplete(), res.whenComplete());
            completionFuture.handle((ret, cause) -> {
                assert responseDecoder != null;
                if (isAcquirable(responseDecoder.keepAliveHandler())) {
                    pooledChannel.release();
                }
                return null;
            });
        }

        try (SafeCloseable ignored = ctx.push()) {
            if (!ctx.exchangeType().isRequestStreaming()) {
                final AggregatedHttpRequestHandler reqHandler = new AggregatedHttpRequestHandler(
                        channel, requestEncoder, responseDecoder, req, res, ctx, writeTimeoutMillis);
                req.aggregate(AggregationOptions.usePooledObjects(ctx.alloc(), channel.eventLoop()))
                   .handle(reqHandler);
                return;
            }

            final AbstractHttpRequestSubscriber subscriber = AbstractHttpRequestSubscriber.of(
                    channel, requestEncoder, responseDecoder, protocol,
                    ctx, req, res, writeTimeoutMillis, isWebSocket());
            req.subscribe(subscriber, channel.eventLoop(), SubscriptionOption.WITH_POOLED_OBJECTS);
        }
    }
{@code true} if an {@link Http2Settings} has been received from the remote endpoint.
core/src/main/java/com/linecorp/armeria/client/HttpSessionHandler.java