public final class ShareableWorkerPool<E extends Worker> extends java.lang.Object implements WorkerPool<E>
WorkerPool should be used if you plan to share a
WorkerPool between different Factories. You will need to call destroy() by your
own once you want to release any resources of it.| Modifier and Type | Field and Description |
|---|---|
private WorkerPool<E> |
wrapped |
| Constructor and Description |
|---|
ShareableWorkerPool(WorkerPool<E> wrapped) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the
ShareableWorkerPool and release all resources. |
E |
nextWorker()
Return the next
Worker to use |
void |
rebuildSelectors()
Replaces the current
Selectors of the Bosses with new Selectors to work around the
infamous epoll 100% CPU bug. |
void |
shutdown()
Shutdown the
NioSelectorPool and all internal created resources |
private final WorkerPool<E extends Worker> wrapped
public ShareableWorkerPool(WorkerPool<E> wrapped)
public E nextWorker()
WorkerPoolWorker to usenextWorker in interface WorkerPool<E extends Worker>public void rebuildSelectors()
NioSelectorPoolSelectors of the Bosses with new Selectors to work around the
infamous epoll 100% CPU bug.rebuildSelectors in interface NioSelectorPoolpublic void destroy()
ShareableWorkerPool and release all resources. After this is called its not usable anymorepublic void shutdown()
NioSelectorPoolNioSelectorPool and all internal created resourcesshutdown in interface NioSelectorPool