When Undertow server feeds org.xnio.XnioWorker#taskPool?

604 Views Asked by At

I am trying to understand how org.xnio.nio.WorkerThread works. As I see it is extended by org.xnio.nio.NioXnioWorker and overrides java.util.concurrent.Executor#execute which "put" Runnable to taskPool. But during debug spring web flux applciation org.xnio.XnioWorker#execute does not invoked and looks like this pool is unused. (A Thread#run with queue polling is used in internals).

Could somebody tell what is the purpose of org.xnio.XnioWorker.TaskPool and under what conditions this pool is fed Runnable tasks by Undertow server?

1

There are 1 best solutions below

1
On

Anytime you have blocking IO it is meant to be run on the worker threads. This is done when dispatch is called and there is a helper handler that does it for you BlockingHandler.