Example usage for io.netty.util.concurrent PromiseNotifier PromiseNotifier

List of usage examples for io.netty.util.concurrent PromiseNotifier PromiseNotifier

Introduction

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

Prototype

@SafeVarargs
public PromiseNotifier(Promise<? super V>... promises) 

Source Link

Document

Create a new instance.

Usage

From source file:com.turo.pushy.apns.ApnsChannelFactory.java

License:Open Source License

/**
 * Destroys a channel by closing it.//from   w  w  w. j a  va2 s. com
 *
 * @param channel the channel to destroy
 * @param promise the promise to notify when the channel has been destroyed
 *
 * @return a future that will be notified when the channel has been destroyed
 */
@Override
public Future<Void> destroy(final Channel channel, final Promise<Void> promise) {
    channel.close().addListener(new PromiseNotifier<>(promise));
    return promise;
}