List of usage examples for io.netty.channel ChannelPromiseNotifier ChannelPromiseNotifier
public ChannelPromiseNotifier(ChannelPromise... promises)
From source file:org.dcache.xrootd.door.ConcurrentXrootdRequestHandler.java
License:Open Source License
@Override protected ChannelFuture respond(ChannelHandlerContext ctx, Object response) { CDC cdc = new CDC(); ChannelPromise promise = ctx.newPromise(); ctx.executor().execute(() -> {/*from www . ja v a 2 s. c om*/ try (CDC ignored = cdc.restore()) { ctx.writeAndFlush(response).addListener(future -> { if (!future.isSuccess()) { exceptionCaught(ctx, future.cause()); } }).addListener(new ChannelPromiseNotifier(promise)); } }); return promise; }