@Override
    public final O execute(ClientRequestContext ctx, I req) throws Exception {
        final CompletableFuture<O> resFuture = new CompletableFuture<>();
        final O deferred = newDeferredResponse(ctx, resFuture);
        concurrencyLimit.acquire(ctx)
                        .handleAsync((permit, throwable) -> {
                            if (throwable != null) {
                                // Wrap the exception with UnprocessedRequestException.
                                final UnprocessedRequestException t =
                                        UnprocessedRequestException.of(throwable);
                                resFuture.completeExceptionally(t);
                                return null;
                            }
                            numActiveRequests.incrementAndGet();
                            try (SafeCloseable ignored = ctx.replace()) {
                                try {
                                    final O actualRes = unwrap().execute(ctx, req);
                                    actualRes.whenComplete().handle((unused, cause) -> {
                                        permit.close();
                                        numActiveRequests.decrementAndGet();
                                        return null;
                                    });
                                    resFuture.complete(actualRes);
                                } catch (Throwable t) {
                                    permit.close();
                                    numActiveRequests.decrementAndGet();
                                    resFuture.completeExceptionally(t);
                                }
                            }
                            return null;
                        }, ctx.eventLoop().withoutContext());
        return deferred;
    }
Returns the number of the {@link Request}s that are being executed.
core/src/main/java/com/linecorp/armeria/client/limit/AbstractConcurrencyLimitingClient.java