Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bridge Netty and Finagle
class ServerBridge[In, Out](
serveTransport: Transport[In, Out] => Unit,
) extends SimpleChannelHandler {
override def channelOpen(
ctx: ChannelHandlerContext,
e: ChannelStateEvent
val channel = e.getChannel
val transport = new ChannelTransport[In, Out](channel) // #1
super.channelOpen(ctx, e)
override def exceptionCaught(
ctx: ChannelHandlerContext,
e: ExceptionEvent
) { // log exception and close channel }
// #1 Is called once a new Channel was open and create a new ChannelTransport to bridge to Finagle
// see
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.