org.http4k.server.Jetty11Loom.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4k-server-jetty11 Show documentation
Show all versions of http4k-server-jetty11 Show documentation
Http4k HTTP Server built on top of jetty v11
package org.http4k.server
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.util.thread.QueuedThreadPool
import org.http4k.server.ServerConfig.StopMode
import java.util.concurrent.Executors.newVirtualThreadPerTaskExecutor
fun Jetty11Loom(port: Int) = Jetty11Loom(port, defaultStopMode)
fun Jetty11Loom(port: Int, stopMode: StopMode) = Jetty11(port, stopMode,
Server(QueuedThreadPool().apply {
virtualThreadsExecutor = newVirtualThreadPerTaskExecutor();
}).apply { addConnector(http(port)(this)) }
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy