Mercurial Hosting > nabble
view src/fschmidt/util/executor/JettyThreadPool.java @ 69:4bc1fc540265 default tip
update luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Oct 2025 20:45:39 -0600 |
parents | 00520880ad02 |
children |
line wrap: on
line source
package fschmidt.util.executor; public final class JettyThreadPool implements org.eclipse.jetty.util.thread.ThreadPool { private final ThreadPool threadPool; public JettyThreadPool(ThreadPool threadPool) { this.threadPool = threadPool; } @Override public boolean dispatch(Runnable job) { return threadPool.dispatch(job); } @Override public void join() throws InterruptedException { threadPool.join(); } @Override public int getThreads() { return threadPool.getPoolSize(); } @Override public int getIdleThreads() { return threadPool.getPoolSize() - threadPool.getActiveCount(); } @Override public boolean isLowOnThreads() { return getIdleThreads() == 0; } }