Thread pooling configurability in Finagle

729 views Asked by At

Let's assume I've got two Finagle services, as per below

val service1: Service[http.Request, http.Response] = ???
val service2: Service[http.Request, http.Response] = ???

and I run them both against different ports

val server1 = Http.serve(":9090", service1)
val server2 = Http.serve(":8080", service2)
  • would requests coming to these 2 servers be handled by different Netty worker/thread pools?
  • if not, is there a way to configure Finagle so they would be handled by different Netty worker/thread pools?
1

There are 1 answers

0
Sam Riyad On

If you are using netty 3, you can set up execution handlers in a pipeline.

http://netty.io/3.5/api/org/jboss/netty/handler/execution/ExecutionHandler.html

Then transform the channel pipeline into a Finagle Codec, which offers builder methods to create a stack client or stack server, and just set the netty3 threadpool size to 0, finagle has been moving towards, hiding netty from it's users which can be a pain when you're trying to get fine grained control.

Hopefully that works, since I see no reason to do that when you can just run the servers in separate jvm instances.