T
- The type of PublisherSource.Subscriber
.public final class ConcurrentTerminalSubscriber<T> extends java.lang.Object implements PublisherSource.Subscriber<T>
PublisherSource.Subscriber
that allows for concurrent delivery of terminal events.Constructor and Description |
---|
ConcurrentTerminalSubscriber(PublisherSource.Subscriber<T> delegate)
Create a new instance.
|
ConcurrentTerminalSubscriber(PublisherSource.Subscriber<T> delegate,
boolean concurrentOnSubscribe)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
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 t)
Callback to receive a
data element for this Subscriber . |
void |
onSubscribe(PublisherSource.Subscription subscription)
Callback to receive a
PublisherSource.Subscription for this Subscriber . |
boolean |
processOnComplete()
Attempt to process
onComplete() . |
boolean |
processOnError(java.lang.Throwable t)
Attempt to process
onError(Throwable) . |
public ConcurrentTerminalSubscriber(PublisherSource.Subscriber<T> delegate)
delegate
- The PublisherSource.Subscriber
to delegate all signals to.public ConcurrentTerminalSubscriber(PublisherSource.Subscriber<T> delegate, boolean concurrentOnSubscribe)
delegate
- The PublisherSource.Subscriber
to delegate all signals to.concurrentOnSubscribe
- false
to not guard for concurrency on
PublisherSource.Subscriber.onSubscribe(PublisherSource.Subscription)
. true
means that
PublisherSource.Subscriber.onSubscribe(PublisherSource.Subscription)
will be protected against concurrent invocation with
terminal methods.public void onSubscribe(PublisherSource.Subscription subscription)
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>
subscription
- PublisherSource.Subscription
for this Subscriber
.public void onNext(@Nullable T t)
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>
t
- 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 boolean processOnError(java.lang.Throwable t)
onError(Throwable)
.t
- The error to process.true
if the terminal signal was propagated to the delegate PublisherSource.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>
public boolean processOnComplete()
onComplete()
.true
if the terminal signal was propagated to the delegate PublisherSource.Subscriber
.