Example usage for io.netty.util.concurrent Future sync

List of usage examples for io.netty.util.concurrent Future sync

Introduction

In this page you can find the example usage for io.netty.util.concurrent Future sync.

Prototype

Future<V> sync() throws InterruptedException;

Source Link

Document

Waits for this future until it is done, and rethrows the cause of the failure if this future failed.

Usage

From source file:nz.co.fortytwo.signalk.server.NettyServer.java

License:Open Source License

public void shutdownServer() {
    logger.info("Stopping ptrans...");
    Future<?> groupShutdownFuture = group.shutdownGracefully();
    Future<?> workerGroupShutdownFuture = workerGroup.shutdownGracefully();
    try {/*from   ww  w  . j  av a 2s.co m*/
        groupShutdownFuture.sync();
    } catch (InterruptedException ignored) {
    }
    try {
        workerGroupShutdownFuture.sync();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    logger.info("Stopped");
}