Package io.smallrye.mutiny.subscription
Class SafeSubscriber<T>
- java.lang.Object
-
- io.smallrye.mutiny.subscription.SafeSubscriber<T>
-
- Type Parameters:
T- the value type
- All Implemented Interfaces:
org.reactivestreams.Subscriber<T>,org.reactivestreams.Subscription
public final class SafeSubscriber<T> extends java.lang.Object implements org.reactivestreams.Subscriber<T>, org.reactivestreams.SubscriptionWraps another Subscriber and ensures all onXXX methods conform the protocol (except the requirement for serialized access).
-
-
Constructor Summary
Constructors Constructor Description SafeSubscriber(org.reactivestreams.Subscriber<? super T> downstream)Constructs a SafeSubscriber by wrapping the given actual Subscriber.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidonComplete()voidonError(java.lang.Throwable t)voidonNext(T t)voidonSubscribe(org.reactivestreams.Subscription subscription)voidrequest(long n)
-
-
-
Constructor Detail
-
SafeSubscriber
public SafeSubscriber(org.reactivestreams.Subscriber<? super T> downstream)
Constructs a SafeSubscriber by wrapping the given actual Subscriber.- Parameters:
downstream- the actual Subscriber to wrap, not null (not validated)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription subscription)
- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onError
public void onError(java.lang.Throwable t)
- Specified by:
onErrorin interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>
-
request
public void request(long n)
- Specified by:
requestin interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
- Specified by:
cancelin interfaceorg.reactivestreams.Subscription
-
-