Package io.smallrye.mutiny.subscription
Class Subscribers.CallbackBasedSubscriber<T>
- java.lang.Object
-
- io.smallrye.mutiny.subscription.Subscribers.CallbackBasedSubscriber<T>
-
- All Implemented Interfaces:
Cancellable,CancellableSubscriber<T>,MultiSubscriber<T>,org.reactivestreams.Subscriber<T>,org.reactivestreams.Subscription
- Enclosing class:
- Subscribers
public static class Subscribers.CallbackBasedSubscriber<T> extends java.lang.Object implements CancellableSubscriber<T>, org.reactivestreams.Subscription
-
-
Constructor Summary
Constructors Constructor Description CallbackBasedSubscriber(java.util.function.Consumer<? super T> onItem, java.util.function.Consumer<? super java.lang.Throwable> onFailure, java.lang.Runnable onCompletion, java.util.function.Consumer<? super org.reactivestreams.Subscription> onSubscription)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Runs the cancellation action.voidonCompletion()Method called when the upstream emits acompletionterminal event.voidonFailure(java.lang.Throwable t)Method called when the upstream emits afailureterminal event.voidonItem(T item)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
-
CallbackBasedSubscriber
public CallbackBasedSubscriber(java.util.function.Consumer<? super T> onItem, java.util.function.Consumer<? super java.lang.Throwable> onFailure, java.lang.Runnable onCompletion, java.util.function.Consumer<? super org.reactivestreams.Subscription> onSubscription)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s)
- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onItem
public void onItem(T item)
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:
item- 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>
-
request
public void request(long n)
- Specified by:
requestin interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
Description copied from interface:CancellableRuns the cancellation action.- Specified by:
cancelin interfaceCancellable- Specified by:
cancelin interfaceorg.reactivestreams.Subscription
-
-