Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在undertow.io中将工作线程分派回XNIO线程?_Java_Jboss_Undertow - Fatal编程技术网

Java 如何在undertow.io中将工作线程分派回XNIO线程?

Java 如何在undertow.io中将工作线程分派回XNIO线程?,java,jboss,undertow,Java,Jboss,Undertow,如何在undertow.io中将工作线程分派回XNIO线程?回调是解决这个问题的方法吗 if (httpServerExchange.isInIoThread()) { httpServerExchange.dispatch(new Runnable() { @Override public void run() { // do something blocking

如何在undertow.io中将工作线程分派回XNIO线程?回调是解决这个问题的方法吗

    if (httpServerExchange.isInIoThread()) {
        httpServerExchange.dispatch(new Runnable() {
            @Override
            public void run() {
                // do something blocking
                // return back to XNIO worker
            }
        });
    }

你为什么要这么做?请描述您的用例。在您的示例中,您正在执行完全相反的操作:从IO线程调度到工作线程。@aramaki我希望能够在工作线程上执行一些阻塞任务,并且在该任务完成后,我希望返回IO线程以继续非阻塞。