private void enqueueAndDispatch(HttpRequest request, ResponseHandler handler, Supplier<BooleanSupplier> operationParser) {
        if (maxThrottled == 0) {
            var operation = new Operation(request, handler, operationParser);
            if (!operation.dispatch()) {
                overload(request, "Rejecting execution due to overload: "
                        + (long)asyncSession.getCurrentWindowSize() + " requests already enqueued", handler);
            }
            return;
        }
        long numQueued = enqueued.incrementAndGet();
        if (numQueued > maxThrottled) {
            enqueued.decrementAndGet();
            overload(request, "Rejecting execution due to overload: "
                    + maxThrottled + " requests already enqueued", handler);
            return;
        }
        if (numQueued > 1) {
            long ageNS = qAgeNS(request);
            if (ageNS > maxThrottledAgeNS) {
                enqueued.decrementAndGet();
                overload(request, "Rejecting execution due to overload: "
                        + maxThrottledAgeNS / 1_000_000_000.0 + " seconds worth of work enqueued", handler);
                return;
            }
        }
        operations.offer(new Operation(request, handler, operationParser));
        dispatchFirst();
    }
Enqueues the given request and operation, or responds with "overload" if the queue is full,
and then attempts to dispatch an enqueued operation from the head of the queue.
vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java