@Override public boolean isShutdown() { for (EventLoop l: activeChildren) { if (!l.isShutdown()) { return false; } } for (EventLoop l: idleChildren) { if (!l.isShutdown()) { return false; } } return true; }
@Override public boolean isShutdown() { for (EventLoop l: activeChildren) { if (!l.isShutdown()) { return false; } } for (EventLoop l: idleChildren) { if (!l.isShutdown()) { return false; } } return true; }
@Override public boolean isShutdown() { for (EventLoop l: activeChildren) { if (!l.isShutdown()) { return false; } } for (EventLoop l: idleChildren) { if (!l.isShutdown()) { return false; } } return true; }
@Override public boolean isShutdown() { for (EventLoop l: activeChildren) { if (!l.isShutdown()) { return false; } } for (EventLoop l: idleChildren) { if (!l.isShutdown()) { return false; } } return true; }
@Override public boolean isShutdown() { for (EventLoop l: activeChildren) { if (!l.isShutdown()) { return false; } } for (EventLoop l: idleChildren) { if (!l.isShutdown()) { return false; } } return true; }
@Override public boolean isShutdown() { for (EventLoop l: activeChildren) { if (!l.isShutdown()) { return false; } } for (EventLoop l: idleChildren) { if (!l.isShutdown()) { return false; } } return true; }
@Override public boolean isShutdown() { return getDelegate().isShutdown(); }
@Override public void sendMessage(BytesReference reference, ActionListener<Void> listener) { ChannelPromise writePromise = channel.newPromise(); writePromise.addListener(f -> { if (f.isSuccess()) { listener.onResponse(null); } else { final Throwable cause = f.cause(); Netty4Utils.maybeDie(cause); assert cause instanceof Exception; listener.onFailure((Exception) cause); } }); channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise); if (channel.eventLoop().isShutdown()) { listener.onFailure(new TransportException("Cannot send message, event loop is shutting down.")); } }
@Override public void sendMessage(BytesReference reference, ActionListener<Void> listener) { ChannelPromise writePromise = channel.newPromise(); writePromise.addListener(f -> { if (f.isSuccess()) { listener.onResponse(null); } else { final Throwable cause = f.cause(); Netty4Utils.maybeDie(cause); assert cause instanceof Exception; listener.onFailure((Exception) cause); } }); channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise); if (channel.eventLoop().isShutdown()) { listener.onFailure(new TransportException("Cannot send message, event loop is shutting down.")); } }
@Override public void sendMessage(BytesReference reference, ActionListener<Void> listener) { ChannelPromise writePromise = channel.newPromise(); writePromise.addListener(f -> { if (f.isSuccess()) { listener.onResponse(null); } else { final Throwable cause = f.cause(); ExceptionsHelper.maybeDieOnAnotherThread(cause); assert cause instanceof Exception; listener.onFailure((Exception) cause); } }); channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise); if (channel.eventLoop().isShutdown()) { listener.onFailure(new TransportException("Cannot send message, event loop is shutting down.")); } }
@Override public void sendMessage(BytesReference reference, ActionListener<Void> listener) { ChannelPromise writePromise = channel.newPromise(); writePromise.addListener(f -> { if (f.isSuccess()) { listener.onResponse(null); } else { final Throwable cause = f.cause(); ExceptionsHelper.maybeDieOnAnotherThread(cause); if (cause instanceof Error) { listener.onFailure(new Exception(cause)); } else { listener.onFailure((Exception) cause); } } }); channel.writeAndFlush(Netty4Utils.toByteBuf(reference), writePromise); if (channel.eventLoop().isShutdown()) { listener.onFailure(new TransportException("Cannot send message, event loop is shutting down.")); } }