Class LatestValueSubscriber<T>
- java.lang.Object
-
- io.servicetalk.concurrent.internal.LatestValueSubscriber<T>
-
- Type Parameters:
T- The type of data.
- All Implemented Interfaces:
PublisherSource.Subscriber<T>
public final class LatestValueSubscriber<T> extends java.lang.Object implements PublisherSource.Subscriber<T>
APublisherSource.Subscriberwhich makes the latest value fromonNext(Object)available outside the context of thePublisherSource.Subscriber.
-
-
Constructor Summary
Constructors Constructor Description LatestValueSubscriber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlastSeenValue(T defaultValue)Get the last seen value.voidonComplete()Callback to signal completion of thePublisherSourcefor thisSubscriber.voidonError(java.lang.Throwable t)Callback to receive anerrorfor thisSubscriber.voidonNext(T newValue)Callback to receive adataelement for thisSubscriber.voidonSubscribe(PublisherSource.Subscription s)Callback to receive aPublisherSource.Subscriptionfor thisSubscriber.
-
-
-
Method Detail
-
onSubscribe
public void onSubscribe(PublisherSource.Subscription s)
Description copied from interface:PublisherSource.SubscriberCallback to receive aPublisherSource.Subscriptionfor thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onSubscribein interfacePublisherSource.Subscriber<T>- Parameters:
s-PublisherSource.Subscriptionfor thisSubscriber.
-
onNext
public void onNext(T newValue)
Description copied from interface:PublisherSource.SubscriberCallback to receive adataelement for thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onNextin interfacePublisherSource.Subscriber<T>- Parameters:
newValue- Adataelement.
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:PublisherSource.SubscriberCallback to receive anerrorfor thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onErrorin interfacePublisherSource.Subscriber<T>- Parameters:
t-errorfor thisSubscriber.
-
onComplete
public void onComplete()
Description copied from interface:PublisherSource.SubscriberCallback to signal completion of thePublisherSourcefor thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onCompletein interfacePublisherSource.Subscriber<T>
-
-