/** * Runs all Nono sources at once and terminates once all of them terminate, * delaying errors in the process. * @param sources the Iterable sequence of Nono sources * @return the new Nono instance */ public static Nono mergeDelayError(Iterable<? extends Nono> sources) { return mergeDelayError(sources, Integer.MAX_VALUE); }
/** * Runs all Nono sources emitted by the Publisher at once and terminates * once all of them terminate, delaying errors in the process. * @param sources the Publisher of Nono sources * @return the new Nono instance */ public static Nono mergeDelayError(Publisher<? extends Nono> sources) { return mergeDelayError(sources, Integer.MAX_VALUE); }
/** * Runs all Nono sources at once and terminates once all of them terminate, * delaying errors in the process. * @param sources the Iterable sequence of Nono sources * @return the new Nono instance */ public static Nono mergeDelayError(Iterable<? extends Nono> sources) { return mergeDelayError(sources, Integer.MAX_VALUE); }
/** * Runs all Nono sources emitted by the Publisher at once and terminates * once all of them terminate, delaying errors in the process. * @param sources the Publisher of Nono sources * @return the new Nono instance */ public static Nono mergeDelayError(Publisher<? extends Nono> sources) { return mergeDelayError(sources, Integer.MAX_VALUE); }
@Test public void mergeIterablePublisherDelayError() { Nono.mergeDelayError(Flowable.range(1, 3) .map(new Function<Integer, Nono>() { @Override public Nono apply(Integer v) throws Exception { return Nono.complete().delay(50, TimeUnit.MILLISECONDS); } })) .test() .awaitDone(5, TimeUnit.SECONDS) .assertResult(); }
@Test public void mergeIterablePublisherMaxConcurrentDelayError() { Nono.mergeDelayError(Flowable.range(1, 3) .map(new Function<Integer, Nono>() { @Override public Nono apply(Integer v) throws Exception { return Nono.complete().delay(50, TimeUnit.MILLISECONDS); } }), 1) .test() .awaitDone(5, TimeUnit.SECONDS) .assertResult(); }
@Test public void mergeIterableDelayErrorError() { Nono.mergeDelayError(Arrays.asList( Nono.complete().delay(50, TimeUnit.MILLISECONDS), ioError.delay(50, TimeUnit.MILLISECONDS), Nono.complete().delay(100, TimeUnit.MILLISECONDS) )) .test() .awaitDone(5, TimeUnit.SECONDS) .assertFailure(IOException.class); }
@Test public void mergeIterableMaxConcurrentDelayErrorError() { Nono.mergeDelayError(Arrays.asList( Nono.complete().delay(50, TimeUnit.MILLISECONDS), ioError.delay(50, TimeUnit.MILLISECONDS), Nono.complete().delay(100, TimeUnit.MILLISECONDS) ), 1) .test() .awaitDone(5, TimeUnit.SECONDS) .assertFailure(IOException.class); }
@Test public void mergeIterableDelayError() { Nono.mergeDelayError(Arrays.asList( Nono.complete().delay(50, TimeUnit.MILLISECONDS), Nono.complete().delay(50, TimeUnit.MILLISECONDS), Nono.complete().delay(100, TimeUnit.MILLISECONDS) )) .test() .awaitDone(5, TimeUnit.SECONDS) .assertResult(); }
@Test public void mergeIterablePublisherMaxConcurrentDelayErrorError() { Nono.mergeDelayError(Flowable.range(1, 3) .map(new Function<Integer, Nono>() { @Override public Nono apply(Integer v) throws Exception { if (v == 2) { return ioError; } return Nono.complete().delay(50, TimeUnit.MILLISECONDS); } }), 1) .test() .awaitDone(5, TimeUnit.SECONDS) .assertFailure(IOException.class); }
@Test public void mergeIterableMaxConcurrentDelayError() { Nono.mergeDelayError(Arrays.asList( Nono.complete().delay(50, TimeUnit.MILLISECONDS), Nono.complete().delay(50, TimeUnit.MILLISECONDS), Nono.complete().delay(100, TimeUnit.MILLISECONDS) ), 1) .test() .awaitDone(5, TimeUnit.SECONDS) .assertResult(); }
@Test public void mergeIterablePublisherDelayErrorError() { Nono.mergeDelayError(Flowable.range(1, 3) .map(new Function<Integer, Nono>() { @Override public Nono apply(Integer v) throws Exception { if (v == 2) { return ioError; } return Nono.complete().delay(50, TimeUnit.MILLISECONDS); } })) .test() .awaitDone(5, TimeUnit.SECONDS) .assertFailure(IOException.class); }