@Override public Flow<X> reduce(Flow<X> accumulator, Flow<X> value) { return accumulator.concat(value); } }, flows.first());
@Override public Flow<X> reduce(Flow<X> accumulator, Flow<X> value) { return accumulator.concat(value); } }, flows.first());
@Override public ZippedFlow<A, B> concat(Collection<? extends Tuple<A, B>> collection) { return create(tupleFlow.concat(collection)); }
@Override public ZippedFlow<A, B> concat(Collection<? extends Tuple<A, B>> collection) { return create(tupleFlow.concat(collection)); }
/** * Fires the {@link RegistryShutdownListener#registryDidShutdown()} method on each listener. At the end, all the * listeners are discarded. */ public void fireRegistryDidShutdown() { lock.lock(); F.flow(preListeners).concat(listeners).each(new Worker<Runnable>() { @Override public void work(Runnable element) { try { element.run(); } catch (RuntimeException ex) { logger.error(ServiceMessages.shutdownListenerError(element, ex), ex); } } }); preListeners.clear(); listeners.clear(); }
/** * Fires the {@link RegistryShutdownListener#registryDidShutdown()} method on each listener. At the end, all the * listeners are discarded. */ public void fireRegistryDidShutdown() { lock.lock(); F.flow(preListeners).concat(listeners).each(new Worker<Runnable>() { @Override public void work(Runnable element) { try { element.run(); } catch (RuntimeException ex) { logger.error(ServiceMessages.shutdownListenerError(element, ex), ex); } } }); preListeners.clear(); listeners.clear(); }
@Test public void concat_list_onto_flow() { Flow<Integer> first = F.flow(1, 2, 3); Flow<Integer> updated = first.concat(Arrays.asList(4, 5, 6)); assertFlowValues(updated, 1, 2, 3, 4, 5, 6); }
.remove(VALUE_IS_NULL).concat( requiredModulesToNames.filter(VALUE_IS_NULL));
@Test public void concat_onto_empty_list() { Flow<Integer> empty = F.flow(); Flow<Integer> flow = F.flow(1, 2, 3); assertSame(empty.concat(flow), flow); }
@Test public void concat_flows() { Flow<Integer> first = F.flow(1, 2, 3); Flow<Integer> updated = first.concat(F.flow(4, 5, 6)); assertFlowValues(updated, 1, 2, 3, 4, 5, 6); }
@Test public void concat_empty_list() { Flow<Integer> flow = F.flow(1, 3); assertFlowValues(flow.concat(flow.filter(evenp)), 1, 3); }
.concat(request.getHeaderNames()) .append("serverName", "removeHost"));
Flow<Integer> flow = F.range(1, 100).map(doubler).concat(F.range(1, 10).map(doubler)); assertEquals(flow.count(), 108); assertEquals(count.get(), 0);