Skip to content

Commit

Permalink
=remote Make use of FlushConsolidationHandler to improve throughput.
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Pin committed Sep 21, 2023
1 parent 7bee80e commit 5740181
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel.socket.SocketChannel
import io.netty.channel.socket.nio.{ NioServerSocketChannel, NioSocketChannel }
import io.netty.handler.codec.{ LengthFieldBasedFrameDecoder, LengthFieldPrepender }
import io.netty.handler.flush.FlushConsolidationHandler
import io.netty.handler.ssl.SslHandler
import io.netty.util.concurrent.GlobalEventExecutor

Expand Down Expand Up @@ -368,6 +369,8 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA

private def newPipeline(channel: Channel): ChannelPipeline = {
val pipeline = channel.pipeline()
pipeline.addFirst("FlushConsolidationHandler",
new FlushConsolidationHandler(FlushConsolidationHandler.DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true))
pipeline.addLast(
"FrameDecoder",
new LengthFieldBasedFrameDecoder(
Expand Down

0 comments on commit 5740181

Please sign in to comment.