Open fernandezpablo85 opened 5 years ago
You can achieve finer-level control by adding this to main() before everything else:
EmbeddedServers.add(
EmbeddedServers.Identifiers.JETTY,
new EmbeddedJettyFactory().withThreadPool(yourCustomThreadPool)
);
Note the ThreadPool is actually Jetty's org.eclipse.jetty.util.thread.ThreadPool, rather than anything in JDK.
Right now spark supports partial configuration of it's underlying
ThreadPool
via:threadPool(maxThreads)
and
threadPool(int maxThreads, int minThreads, int idleTimeoutMillis)
Though convenient, these fall short when more fine tuning is needed, like configuring a blocking queue or a custom
ThreadFactory
.I'd be great to have something like
threadPool(ThreadPoolExecutor executor)
or equivalent.