Skip to content

Commit

Permalink
Support extra configuration in Netty Epoll adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguililla committed Nov 5, 2023
1 parent c63ecda commit 6a84138
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ open class NettyServerAdapter(
soKeepAlive = true,
shutdownQuietSeconds = 0,
shutdownTimeoutSeconds = 0,
keepAliveHandler = true,
httpAggregatorHandler = true,
chunkedHandler = true,
enableWebsockets = true,
)

override fun runtimePort(): Int =
Expand Down
4 changes: 2 additions & 2 deletions http/http_server_netty_epoll/api/http_server_netty_epoll.api
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public final class com/hexagonkt/http/server/netty/epoll/NettyEpollServerAdapter : com/hexagonkt/http/server/netty/NettyServerAdapter {
public fun <init> ()V
public fun <init> (IIIIZZ)V
public synthetic fun <init> (IIIIZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (IIIIZZJJZZZZ)V
public synthetic fun <init> (IIIIZZJJZZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun groupSupplier (I)Lio/netty/channel/MultithreadEventLoopGroup;
public fun serverBootstrapSupplier (Lio/netty/channel/MultithreadEventLoopGroup;Lio/netty/channel/MultithreadEventLoopGroup;)Lio/netty/bootstrap/ServerBootstrap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,29 @@ class NettyEpollServerAdapter(
private val soBacklog: Int = 4 * 1_024,
private val soReuseAddr: Boolean = true,
private val soKeepAlive: Boolean = true,
shutdownQuietSeconds: Long = 0,
shutdownTimeoutSeconds: Long = 0,
keepAliveHandler: Boolean = true,
httpAggregatorHandler: Boolean = true,
chunkedHandler: Boolean = true,
enableWebsockets: Boolean = true,
) : NettyServerAdapter(
bossGroupThreads,
workerGroupThreads,
executorThreads,
soBacklog,
soReuseAddr,
soKeepAlive,
shutdownQuietSeconds,
shutdownTimeoutSeconds,
keepAliveHandler,
httpAggregatorHandler,
chunkedHandler,
enableWebsockets,
) {

constructor() : this(1, 0, Jvm.cpuCount * 2, 4 * 1_024, true, true)
constructor() :
this(1, 0, Jvm.cpuCount * 2, 4 * 1_024, true, true, 0, 0, true, true, true, true)

override fun groupSupplier(it: Int): MultithreadEventLoopGroup =
EpollEventLoopGroup(it)
Expand Down

0 comments on commit 6a84138

Please sign in to comment.