<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 24 Oct 2019 at 01:23, Pavel Shirshov &lt;<a href="mailto:pshirshov@gmail.com">pshirshov@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi guys,</div><div><br></div><div>Could you give me a hint if there is a way to write asynchronous handlers?</div><div>So,
 I have my own asynchronous runtime (namely ZIO) and I wish undertow&#39;s 
worker thread to do something while it&#39;s waiting for request completion 
after a `dispatch` in my handler.</div><div><br></div><div>Is there an API allowing me to return a Future or undertow&#39;s IOFuture so I may write an adaptor for my primitives?..</div><div><br></div><div>From what I can see there is that zero-arg `.dispatch()` method which just changes internal flag. So, from what I can understand I may just set that flag and then complete my request totally asynchronously. Though that method is marked deprecated without an alternative - other versions also wait for a `Runnable`.<br></div></div></blockquote><div><br></div><div>In general you should not used the no arg version of dispatch(), it has been deprecated as it is not thread safe. </div><div><br></div><div>If you want to just dispatch some work to a worker using the version that takes a runnable sounds like exactly what you are after, as it will run the runnable in a worker thread.</div><div><br></div><div>Stuart</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><br>-- <br><div dir="ltr">Thanks,<br>    Pavel</div></div>
_______________________________________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org" target="_blank">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/mailman/listinfo/undertow-dev</a></blockquote></div></div>