<div dir="ltr">So what would be the right workflow using Receiver to read a large request, do something time-consuming, and send back a response? Use Receiver callbacks to write partial payloads to disk, and the last callback then dispatch to a worker thread?<div><br></div><div>Cheers,</div><div><br></div><div>Mike</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 31, 2017 at 6:30 AM, Stuart Douglas <span dir="ltr"><<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It will generally be handled by an IO thread, although it can depend<br>
on how large the request is. If a request is small enough that it gets<br>
read immediately then the request will be handled in the same thread,<br>
otherwise it will be handled by the IO thread to full read the<br>
request.<br>
<span class="HOEnZb"><font color="#888888"><br>
Stuart<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, Mar 31, 2017 at 8:05 PM, Antoine Girard<br>
<<a href="mailto:antoine.girard@ymail.com">antoine.girard@ymail.com</a>> wrote:<br>
> Correct me if I am wrong Stuart but if the request was already dispatched<br>
> before calling the getRequestReceiver(), then the callback will be handled<br>
> by a worker thread.<br>
><br>
> Cheers,<br>
> Antoine<br>
><br>
> On Thu, Mar 30, 2017 at 11:48 PM, Stuart Douglas <<a href="mailto:sdouglas@redhat.com">sdouglas@redhat.com</a>><br>
> wrote:<br>
>><br>
>> No, the callback is invoked by the IO thread, so you would need to<br>
>> dispatch to a worker thread.<br>
>><br>
>> Stuart<br>
>><br>
>> On Fri, Mar 31, 2017 at 6:58 AM, Michael Grove <<a href="mailto:mike@stardog.com">mike@stardog.com</a>> wrote:<br>
>> > If I have some code ala<br>
>> ><br>
>> > theRequest.getRequestReceiver(<wbr>).receiveFullString((<wbr>theExchange, str) -><br>
>> > {<br>
>> > ...<br>
>> > });<br>
>> ><br>
>> > Is it ok to perform a time consuming task w/ the body of the request in<br>
>> > the<br>
>> > callback, or is it better to move off the io thread and use<br>
>> > `HttpServerExchange.<wbr>getInputStream`?<br>
>> ><br>
>> > Cheers,<br>
>> ><br>
>> > Mike<br>
>> ><br>
>> > ______________________________<wbr>_________________<br>
>> > undertow-dev mailing list<br>
>> > <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
>> > <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
>> ______________________________<wbr>_________________<br>
>> undertow-dev mailing list<br>
>> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>