Package io.smallrye.mutiny.helpers
Class StrictMultiSubscriber<T>
- java.lang.Object
-
- io.smallrye.mutiny.helpers.StrictMultiSubscriber<T>
-
- Type Parameters:
T- the type of item
- All Implemented Interfaces:
MultiSubscriber<T>,org.reactivestreams.Subscriber<T>,org.reactivestreams.Subscription
public class StrictMultiSubscriber<T> extends java.lang.Object implements MultiSubscriber<T>, org.reactivestreams.Subscription
Ensures that the events between the upstream and downstream follow the Reactive Streams specification. Typically:- 1.3: onNext should not be called concurrently until onSubscribe returns
- 2.3: onError or onComplete must not call cancel
- 3.9: negative requests should emit an onError(IllegalArgumentException)
- 2.12: onSubscribe must be called at most once (subscription cancelled and onError called)
-
-
Constructor Summary
Constructors Constructor Description StrictMultiSubscriber(org.reactivestreams.Subscriber<? super T> downstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidonCompletion()Method called when the upstream emits acompletionterminal event.voidonFailure(java.lang.Throwable t)Method called when the upstream emits afailureterminal event.voidonItem(T t)Method called when the upstream emits anitemevent, in response to to requests toSubscription.request(long).voidonSubscribe(org.reactivestreams.Subscription s)voidrequest(long n)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.mutiny.subscription.MultiSubscriber
onComplete, onError, onNext
-
-
-
-
Constructor Detail
-
StrictMultiSubscriber
public StrictMultiSubscriber(org.reactivestreams.Subscriber<? super T> downstream)
-
-
Method Detail
-
request
public void request(long n)
- Specified by:
requestin interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
- Specified by:
cancelin interfaceorg.reactivestreams.Subscription
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s)
- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onItem
public void onItem(T t)
Description copied from interface:MultiSubscriberMethod called when the upstream emits anitemevent, in response to to requests toSubscription.request(long).- Specified by:
onItemin interfaceMultiSubscriber<T>- Parameters:
t- the item, must not benull.
-
onFailure
public void onFailure(java.lang.Throwable t)
Description copied from interface:MultiSubscriberMethod called when the upstream emits afailureterminal event.No further events will be sent even if
Subscription.request(long)is invoked again.- Specified by:
onFailurein interfaceMultiSubscriber<T>- Parameters:
t- the failure, must not benull.
-
onCompletion
public void onCompletion()
Description copied from interface:MultiSubscriberMethod called when the upstream emits acompletionterminal event.No further events will be sent even if
Subscription.request(long)is invoked again.- Specified by:
onCompletionin interfaceMultiSubscriber<T>
-
-