Package io.servicetalk.concurrent.api
Class LoggingPublisherSubscriber<T>
- java.lang.Object
-
- io.servicetalk.concurrent.api.LoggingPublisherSubscriber<T>
-
- Type Parameters:
T- Type of items received by theSubscriber.
- All Implemented Interfaces:
PublisherSource.Subscriber<T>
public class LoggingPublisherSubscriber<T> extends java.lang.Object implements PublisherSource.Subscriber<T>
APublisherSource.Subscriberthat wraps anotherPublisherSource.Subscriber, logging all signals received by thePublisherSource.Subscriber, or sent via thePublisherSource.Subscription.
-
-
Constructor Summary
Constructors Constructor Description LoggingPublisherSubscriber(java.lang.String name, PublisherSource.Subscriber<T> delegate)Create aLoggingPublisherSubscriberthat wraps thedelegate, and uses the specifiednamefor logging.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonComplete()Callback to signal completion of thePublisherSourcefor thisSubscriber.voidonError(java.lang.Throwable t)Callback to receive anerrorfor thisSubscriber.voidonNext(T t)Callback to receive adataelement for thisSubscriber.voidonSubscribe(PublisherSource.Subscription s)Callback to receive aPublisherSource.Subscriptionfor thisSubscriber.
-
-
-
Constructor Detail
-
LoggingPublisherSubscriber
public LoggingPublisherSubscriber(java.lang.String name, PublisherSource.Subscriber<T> delegate)Create aLoggingPublisherSubscriberthat wraps thedelegate, and uses the specifiednamefor logging.- Parameters:
name- the logging name.delegate- thePublisherSource.Subscriberto delegate calls to.
-
-
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 t)
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:
t- 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>
-
-