XNIO workers are the central point of coordination for a network application. A worker includes two different thread pool types:
I/O threads, which come in two types:
Read threads which handle callbacks for read events, and
Write threads which handle callbacks for write events; and
Worker threads, which come from a fully configurable standard Executor-based thread pool.
I/O threads are used by XNIO for the purpose of notification but also may be used by the user to execute tasks or perform cancellable actions after an elapsed timeout; these are represented by the XnioExecutor interface. The worker thread pool exists for the user's use. Threads created by the worker are tagged with the worker name, to make them easier to identify in thread dumps and log files.
In addition to managing the thread pools and event callbacks, the worker is also the object from which most channels can be created; these include pipes and sockets of various types.
When a worker is no longer needed, it should be shut down using the shutdown method. When the worker's shutdown process is complete, the shutdown complete task (if any) which was registered upon creation of the worker is executed (typically from the last thread in the worker pool, before it is terminated).