T
- Type of items received by the Subscriber
.public class LoggingPublisherSubscriber<T> extends java.lang.Object implements PublisherSource.Subscriber<T>
PublisherSource.Subscriber
that wraps another PublisherSource.Subscriber
, logging all signals received by the PublisherSource.Subscriber
,
or sent via the PublisherSource.Subscription
.Constructor and Description |
---|
LoggingPublisherSubscriber(java.lang.String name,
PublisherSource.Subscriber<T> delegate)
Create a
LoggingPublisherSubscriber that wraps the delegate , and uses the specified name
for logging. |
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 s)
Callback to receive a
PublisherSource.Subscription for this Subscriber . |
public LoggingPublisherSubscriber(java.lang.String name, PublisherSource.Subscriber<T> delegate)
LoggingPublisherSubscriber
that wraps the delegate
, and uses the specified name
for logging.name
- the logging name.delegate
- the PublisherSource.Subscriber
to delegate calls to.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 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 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>