From 0517fac42eeac134eff74bbd728bf1659a72bf0e Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 28 Jun 2012 17:24:14 +0200 Subject: [PATCH] Making use-dispatcher-for-io also used for the client connector --- .../scala/akka/remote/netty/NettyRemoteSupport.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 5e3c989fd5..5c506abfc8 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -40,10 +40,13 @@ private[akka] class NettyRemoteTransport(_system: ExtendedActorSystem, _provider // TODO replace by system.scheduler val timer: HashedWheelTimer = new HashedWheelTimer(system.threadFactory) - // TODO make configurable/shareable with server socket factory - val clientChannelFactory = new NioClientSocketChannelFactory( - Executors.newCachedThreadPool(system.threadFactory), - Executors.newCachedThreadPool(system.threadFactory)) + val clientChannelFactory = settings.UseDispatcherForIO match { + case Some(id) ⇒ + val d = system.dispatchers.lookup(id) + new NioClientSocketChannelFactory(d, d) + case None ⇒ + new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()) + } /** * Backing scaffolding for the default implementation of NettyRemoteSupport.createPipeline.