/** * Detaches this instance from all its {@link #siblings}. */ public void removeSiblings() { this.removeSiblingsWhere((channel) -> true); }
/** * Scrap any consumer {@link ExecutionTask}s and sibling {@link Channel}s that are not within the given * {@link ExecutionStage}s. * * @return whether consumer {@link ExecutionTask}s have been removed */ public boolean retain(Set<ExecutionStage> retainableStages) { boolean isConsumersRemoved = this.consumers.removeIf(consumer -> !retainableStages.contains(consumer.getStage())); this.removeSiblingsWhere((sibling) -> !retainableStages.contains(sibling.getProducer().getStage())); return isConsumersRemoved; }