public void close(@Nullable final Consumer<Boolean> onClose) { for (Registration<? extends NetChannel<IN, OUT>> reg : getChannels()) { if (!reg.isCancelled()) { doCloseChannel(reg.getObject()); } } if (null != onClose) { reactor.schedule(onClose, true); } }
public Iterator<NetChannel<IN, OUT>> iterator() { FastList<NetChannel<IN, OUT>> channels = FastList.newList(); for (Registration<? extends NetChannel<IN, OUT>> reg : getChannels()) { channels.add(reg.getObject()); } return channels.iterator(); }