T
- The type of data.public final class LatestValueSubscriber<T> extends java.lang.Object implements PublisherSource.Subscriber<T>
PublisherSource.Subscriber
which makes the latest value from onNext(Object)
available outside the context of the
PublisherSource.Subscriber
.Constructor and Description |
---|
LatestValueSubscriber() |
Modifier and Type | Method and Description |
---|---|
T |
lastSeenValue(T defaultValue)
Get the last seen value.
|
void |
onComplete()
Callback to signal completion of the
PublisherSource for this Subscriber . |
void |
onError(java.lang.Throwable t)
Callback to receive an
error for this Subscriber . |
void |
onNext(T newValue)
Callback to receive a
data element for this Subscriber . |
void |
onSubscribe(PublisherSource.Subscription s)
Callback to receive a
PublisherSource.Subscription for this Subscriber . |
public void onSubscribe(PublisherSource.Subscription s)
PublisherSource.Subscriber
PublisherSource.Subscription
for this Subscriber
.
See Reactive Streams specifications for the rules about how and when this method will be invoked.
onSubscribe
in interface PublisherSource.Subscriber<T>
s
- PublisherSource.Subscription
for this Subscriber
.public void onNext(T newValue)
PublisherSource.Subscriber
data
element for this Subscriber
.
See Reactive Streams specifications for the rules about how and when this method will be invoked.
onNext
in interface PublisherSource.Subscriber<T>
newValue
- A data
element.public void onError(java.lang.Throwable t)
PublisherSource.Subscriber
error
for this Subscriber
.
See Reactive Streams specifications for the rules about how and when this method will be invoked.
onError
in interface PublisherSource.Subscriber<T>
t
- error
for this Subscriber
.public void onComplete()
PublisherSource.Subscriber
PublisherSource
for this Subscriber
.
See Reactive Streams specifications for the rules about how and when this method will be invoked.
onComplete
in interface PublisherSource.Subscriber<T>