Remote startup / Shudown of a netty server
Brendt
draco2k4 at yahoo.com
Thu Jan 27 15:22:19 EST 2011
Hi Trustin,
Thanks for the reply.
My stop method only stops that particular proxy, so I'm not terminating the
Java process in that method. On terminating all the resources used by that
NioServerSocketChannelFactory... I construct ALL my proxies using the same
boss and worker thread pools, so if I call
myNioServerSocketChannelFactory.releaseExternalResources() all of my proxies
will terminate. Am I wrong in using the same boss/worker thread pools in
all of my proxies (should I instead construct new boss/worker thread pools
per proxy?). I use the same concept for my proxy connections to the backend
server. So each NioClientSocketChannelFactory uses the same boss/worker
thread pool.
...
// Shared Executors
// one set for proxies (web -> proxy)
// another for backend servers (proxy -> apache/nginx/tomcat/etc.)
Executor proxyBoss = Executors.newCachedThreadPool();
Executor proxyWorker = Executors.newCachedThreadPool();
Executor serverBoss = Executors.newCachedThreadPool();
Executor serverWorker = Executors.newCachedThreadPool();
...
ChannelFactory proxyFactory1 = new NioServerSocketChannelFactory(proxyBoss,
proxyWorker);
ChannelFactory proxyFactory2 = new NioServerSocketChannelFactory(proxyBoss,
proxyWorker);
ChannelFactory serverFactory1 = new
NioServerSocketChannelFactory(serverBoss, serverWorker);
ChannelFactory serverFactory2 = new
NioServerSocketChannelFactory(serverBoss, serverWorker);
...
I hope the code is a better explanation :)
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Remote-startup-Shudown-of-a-netty-server-tp5925249p5967665.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list