public void shutdown() throws InterruptedException { try { logger.info("Shutting down Riposte..."); List<ChannelFuture> channelCloseFutures = new ArrayList<>(); for (Channel ch : channels) { // execute shutdown hooks if (serverConfig.serverShutdownHooks() != null) { for (ServerShutdownHook hook : serverConfig.serverShutdownHooks()) { hook.executeServerShutdownHook(serverConfig, ch); } } channelCloseFutures.add(ch.close()); } for (ChannelFuture chf : channelCloseFutures) { chf.sync(); } } finally { eventLoopGroups.forEach(EventExecutorGroup::shutdownGracefully); logger.info("...Riposte shutdown complete"); } } }
public void shutdown() throws InterruptedException { try { logger.info("Shutting down Riposte..."); List<ChannelFuture> channelCloseFutures = new ArrayList<>(); for (Channel ch : channels) { // execute shutdown hooks if (serverConfig.serverShutdownHooks() != null) { for (ServerShutdownHook hook : serverConfig.serverShutdownHooks()) { hook.executeServerShutdownHook(serverConfig, ch); } } channelCloseFutures.add(ch.close()); } for (ChannelFuture chf : channelCloseFutures) { chf.sync(); } } finally { eventLoopGroups.forEach(EventExecutorGroup::shutdownGracefully); logger.info("...Riposte shutdown complete"); } } }