private void completeAndFinishTask(CompletionHandler handler, Consumer<CompletionHandler> invocation) {
            try {
                invocation.accept(handler != null ? handler : CompletionHandlers.noop());
            } catch (Throwable ex) {
                log.log(Level.WARNING, "Failed to call completion handler", ex);
            } finally {
                synchronized (monitor) {
                    canWrite = true;
                    tryProcessQueue();
                }
            }
        }
A {@link ResponseHandler} that writes the response to Jetty ({@link org.eclipse.jetty.server.Response}).

@author bjorncs
container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyResponseWriter.java