[undertow-dev] Question about endExchange() and response Sender

Mario Carbajal mario.e.carbajal at gmail.com
Mon Mar 19 09:23:31 EDT 2018


In a dispatched non-blocking HttpRequest handler I'm calling endExchange
immediately after calling send on the response Sender. I am unsure if this
will cause the sender to be interrupted or if the exchange will end only
after the sender is done writing the data.

The code looks like this:

@Override
public void handleRequest(HttpServerExchange exchange) throws Exception
{
    if (exchange.isInIoThread()) {
        exchange.dispatch(this);
        return;
    }

    try {
        ... do things ...
        exchange.getResponseSender().send(data);
    }finally {
        exchange.endExchange();
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180319/fa05da27/attachment.html 


More information about the undertow-dev mailing list