/** * Block until this Nono terminates and ignore the actual events. * @since 0.13.0 */ public final void blockingSubscribe() { blockingSubscribe(Functions.EMPTY_ACTION, Functions.ERROR_CONSUMER); }
/** * Runs the Nono sources emitted by the Publisher one after the other. * @param sources the Publisher of Nono sources * @return the new Nono instance */ public static Nono concat(Publisher<? extends Nono> sources) { return concat(sources, 2); }
/** * Runs the Nono sources emitted by the Publisher, one after the other, delaying errors from them * till all sources have terminated. * @param sources the Publisher of source Nonos * @return the new Nono instances */ public static Nono concatDelayError(Publisher<? extends Nono> sources) { return concatDelayError(sources, 2, true); }
/** * Delays the actual subscription to this Nono until the given * time passes. * @param delay the delay amount * @param unit the time unit * @return the new Nono instance */ public final Nono delaySubscription(long delay, TimeUnit unit) { return delaySubscription(timer(delay, unit)); }
/** * Runs all Nono sources at once and terminates once all * of them terminate, delaying errors in the process. * @param sources the array of Nono sources * @return the new Nono instance */ public static Nono mergeArrayDelayError(Nono... sources) { return mergeArrayDelayError(bufferSize(), sources); }
@Test public void timeout7() { Nono.fromAction(this) .delay(1, TimeUnit.SECONDS) .timeout(10, TimeUnit.MILLISECONDS, Nono.fromAction(this)) .test() .awaitDone(5, TimeUnit.SECONDS) .assertResult(); Assert.assertEquals(2, count); }
@Test public void delaySubscription4() { Nono.fromAction(this).delaySubscription(Flowable.error(new IOException())) .test() .assertFailure(IOException.class); Assert.assertEquals(0, count); }
@Test public void concatIterableDelayError() { Nono.concatDelayError( Arrays.asList(Nono.fromAction(this), Nono.error(new IOException()), Nono.fromAction(this))) .test() .assertFailure(IOException.class); Assert.assertEquals(2, count); }
@Test public void blockingAwaitDelayed() { Assert.assertNull(Nono.complete().delay(10, TimeUnit.MILLISECONDS).blockingAwait()); }
@Test public void blockingSubscribe() { Nono.fromAction(this) .delay(100, TimeUnit.MILLISECONDS) .blockingSubscribe(); }
@Test public void fromPublisher5() { Nono.fromPublisher(Flowable.error(new IOException())) .test() .assertFailure(IOException.class); }
@Test public void concatIterable() { Nono.concat(Arrays.asList(Nono.fromAction(this), Nono.fromAction(this))) .test() .assertResult(); Assert.assertEquals(2, count); }
@Test public void concatIterableError() { Nono.concat(Arrays.asList(Nono.fromAction(this), Nono.error(new IOException()))) .test() .assertFailure(IOException.class); Assert.assertEquals(1, count); }
@Test public void blockingAwaitDelayedErrorWithTimeout() { Assert.assertNotNull(ioError.delay(10, TimeUnit.MILLISECONDS).blockingAwait(5, TimeUnit.SECONDS)); }
@Test public void delaySubscription1() { Nono.fromAction(this).delaySubscription(Nono.complete()) .test() .assertResult(); Assert.assertEquals(1, count); }