private void shutdownGracefully ( final Iterator < EventExecutorGroup > iterator ) { if ( iterator . hasNext ( ) ) { EventExecutorGroup group = iterator . next ( ) ; if ( ! group . isShuttingDown ( ) ) { group . shutdownGracefully ( ) . addListener ( future -> { if ( ! future . isSuccess ( ) ) { log . debug ( "shutdown of {} resulted in exception" , group , future . cause ( ) ) ; } shutdownGracefully ( iterator ) ; } ) ; } } }
Shutdown executor in order .