@Test public void testNormal() { AtomicReference<UniEmitter<? super Integer>> reference = new AtomicReference<>(); AbstractUni<? super Integer> uni = (AbstractUni<? super Integer>) Uni.createFrom().<Integer> emitter( reference::set); UniAssertSubscriber<Object> subscriber = UniAssertSubscriber.create(); UniSerializedSubscriber.subscribe(uni, subscriber); subscriber.assertSubscribed(); reference.get().complete(1); reference.get().complete(2); reference.get().fail(new IOException("boom")); subscriber .assertCompletedSuccessfully() .assertNoFailure() .assertItem(1); }
public static <T> void subscribe(AbstractUni<T> source, UniSubscriber<? super T> subscriber) { UniSubscriber<? super T> actual = Infrastructure.onUniSubscription(source, subscriber); UniSerializedSubscriber<T> wrapped = new UniSerializedSubscriber<>(source, actual); wrapped.subscribe(); }
UniSerializedSubscriber implements UniSubscriber<T>, UniSubscription { public static <T> void subscribe(AbstractUni<T> source, UniSubscriber<? super T> subscriber) { UniSubscriber<? super T> actual = Infrastructure.onUniSubscription(source, subscriber); UniSerializedSubscriber<T> wrapped = new UniSerializedSubscriber<>(source, actual); wrapped.subscribe(); } }
UniSerializedSubscriber implements UniSubscriber<T>, UniSubscription { public static <T> void subscribe(AbstractUni<T> source, UniSubscriber<? super T> subscriber) { UniSubscriber<? super T> actual = Infrastructure.onUniSubscription(source, subscriber); UniSerializedSubscriber<T> wrapped = new UniSerializedSubscriber<>(source, actual); wrapped.subscribe(); } UniSerializedSubscriber(AbstractUni<T> upstream, UniSubscriber<? super T> subscriber); }
UniSerializedSubscriber implements UniSubscriber<T>, UniSubscription { public static <T> void subscribe(AbstractUni<T> source, UniSubscriber<? super T> subscriber) { UniSubscriber<? super T> actual = Infrastructure.onUniSubscription(source, subscriber); UniSerializedSubscriber<T> wrapped = new UniSerializedSubscriber<>(source, actual); wrapped.subscribe(); } UniSerializedSubscriber(AbstractUni<T> upstream, UniSubscriber<? super T> subscriber); static void subscribe(AbstractUni<T> source, UniSubscriber<? super T> subscriber); @Override void onSubscribe(UniSubscription subscription); @Override void onItem(T item); @Override void onFailure(Throwable throwable); @Override void cancel(); synchronized boolean isCancelledOrDone(); }
UniSerializedSubscriber implements UniSubscriber<T>, UniSubscription { public static <T> void subscribe(AbstractUni<T> source, UniSubscriber<? super T> subscriber) { UniSubscriber<? super T> actual = Infrastructure.onUniSubscription(source, subscriber); UniSerializedSubscriber<T> wrapped = new UniSerializedSubscriber<>(source, actual); wrapped.subscribe(); } UniSerializedSubscriber(AbstractUni<T> upstream, UniSubscriber<? super T> subscriber); static void subscribe(AbstractUni<T> source, UniSubscriber<? super T> subscriber); @Override void onSubscribe(UniSubscription subscription); @Override void onItem(T item); @Override void onFailure(Throwable throwable); @Override void cancel(); synchronized boolean isCancelledOrDone();  }