Returns two new channels: elements matching the predicate go to the first, non-matching to the second. Both are closed when this channel is exhausted. @param predicate the split condition @return a list of two channels: [matching, non-matching] @since 6.0.0
(Predicate<T> predicate)
| 219 | * @since 6.0.0 |
| 220 | */ |
| 221 | default List<AsyncChannel<T>> split(Predicate<T> predicate) { |
| 222 | AsyncChannel<T> trueOut = create(getCapacity()); |
| 223 | AsyncChannel<T> falseOut = create(getCapacity()); |
| 224 | AsyncSupport.getExecutor().execute(() -> { |
no outgoing calls