Skip to content

Instantly share code, notes, and snippets.

@caniszczyk
Created February 10, 2014 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caniszczyk/8920827 to your computer and use it in GitHub Desktop.
Save caniszczyk/8920827 to your computer and use it in GitHub Desktop.
Bridging Netty and Finagle
object Netty3Transporter {
val channelFactory: ChannelFactory =
new NioClientSocketChannelFactory(
Executor, 1 /*# boss threads*/, WorkerPool, DefaultTimer
){
// no-op; unreleasable
override def releaseExternalResources() = ()
} #1
val defaultChannelOptions: Map[String, Object] = Map(
"tcpNoDelay" -> java.lang.Boolean.TRUE,
"reuseAddress" -> java.lang.Boolean.TRUE #2
)
}
// #1 Create a new ChannelFactory instance
// #2 Set options which are used for new Channels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment