Changing so that you can specify any dispatcher id to be used for remoting

This commit is contained in:
Viktor Klang 2012-04-27 01:10:20 +02:00
parent 45694c65f4
commit a99d980bb9
3 changed files with 15 additions and 8 deletions

View file

@ -26,10 +26,14 @@ class NettyRemoteServer(val netty: NettyRemoteTransport) {
val ip = InetAddress.getByName(settings.Hostname)
private val factory = {
val boss, worker = if (settings.UseDefaultDispatcherForIO) netty.system.dispatcher else Executors.newCachedThreadPool()
new NioServerSocketChannelFactory(boss, worker)
}
private val factory =
settings.UseDispatcherForIO match {
case Some(id)
val d = netty.system.dispatchers.lookup(id)
new NioServerSocketChannelFactory(d, d)
case None
new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool())
}
private val executionHandler = new ExecutionHandler(netty.executor)