org.http4k.server.JettyLoom.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4k-server-jetty Show documentation
Show all versions of http4k-server-jetty Show documentation
Http4k HTTP Server built on top of jetty
The newest version!
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 JettyLoom(port: Int) = JettyLoom(port, defaultStopMode)
fun JettyLoom(port: Int, stopMode: StopMode) = Jetty(port, stopMode,
Server(QueuedThreadPool().apply {
virtualThreadsExecutor = newVirtualThreadPerTaskExecutor();
}).apply { addConnector(http(port)(this)) }
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy