Class SubscriberHelpers.ObservableSubscriber<T>
java.lang.Object
org.nustaq.kontraktor.services.rlserver.mongodb.SubscriberHelpers.ObservableSubscriber<T>
- Type Parameters:
T- The publishers result type
- All Implemented Interfaces:
org.reactivestreams.Subscriber<T>
- Direct Known Subclasses:
SubscriberHelpers.OperationSubscriber
- Enclosing class:
- SubscriberHelpers
public static class SubscriberHelpers.ObservableSubscriber<T>
extends java.lang.Object
implements org.reactivestreams.Subscriber<T>
A Subscriber that stores the publishers results and provides a latch so can block on completion.
-
Method Summary
Modifier and Type Method Description SubscriberHelpers.ObservableSubscriber<T>await()SubscriberHelpers.ObservableSubscriber<T>await(long timeout, java.util.concurrent.TimeUnit unit)java.util.List<T>get(long timeout, java.util.concurrent.TimeUnit unit)java.lang.ThrowablegetError()java.util.List<T>getReceived()org.reactivestreams.SubscriptiongetSubscription()booleanisCompleted()voidonComplete()voidonError(java.lang.Throwable t)voidonNext(T t)voidonSubscribe(org.reactivestreams.Subscription s)
-
Method Details
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s)- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onNext
- Specified by:
onNextin 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>
-
getSubscription
public org.reactivestreams.Subscription getSubscription() -
getReceived
-
getError
public java.lang.Throwable getError() -
isCompleted
public boolean isCompleted() -
get
public java.util.List<T> get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.Throwable- Throws:
java.lang.Throwable
-
await
- Throws:
java.lang.Throwable
-
await
public SubscriberHelpers.ObservableSubscriber<T> await(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.Throwable- Throws:
java.lang.Throwable
-