@Override
    protected CloseableHttpResponse doExecute(
            final HttpHost target,
            final ClassicHttpRequest request,
            final HttpContext context) throws IOException {
        final ClassicToAsyncRequestProducer requestProducer = new ClassicToAsyncRequestProducer(request, operationTimeout);
        final ClassicToAsyncResponseConsumer responseConsumer = new ClassicToAsyncResponseConsumer(operationTimeout);
        final Future<Void> resultFuture = client.execute(target, requestProducer, responseConsumer, null, context, null);
        if (request instanceof CancellableDependency) {
            ((CancellableDependency) request).setDependency(() -> resultFuture.cancel(true));
        }
        try {
            requestProducer.blockWaiting().execute();
            final ClassicHttpResponse response = responseConsumer.blockWaiting();
            return CloseableHttpResponse.create(response,
                    (closeable, closeMode) -> {
                        try {
                            if (closeMode == CloseMode.GRACEFUL) {
                                closeable.close();
                            }
                        } finally {
                            resultFuture.cancel(true);
                        }
                    });
        } catch (final InterruptedException ex) {
            Thread.currentThread().interrupt();
            throw new InterruptedIOException();
        }
    }
{@link CloseableHttpClient} implementation backed by {@link CloseableHttpAsyncClient}
acting as a compatibility bridge with the classic APIs based on the standard
{@link java.io.InputStream} / {@link java.io.OutputStream} model.

@since 5.5
httpclient5/src/main/java/org/apache/hc/client5/http/impl/compat/ClassicToAsyncAdaptor.java