Changing so that you can specify any dispatcher id to be used for remoting
This commit is contained in:
parent
45694c65f4
commit
a99d980bb9
3 changed files with 15 additions and 8 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue