Package io.servicetalk.concurrent.api
Class LoggingSingleSubscriber<T>
- java.lang.Object
-
- io.servicetalk.concurrent.api.LoggingSingleSubscriber<T>
-
- Type Parameters:
T- Type of items received by theSubscriber.
- All Implemented Interfaces:
SingleSource.Subscriber<T>
public class LoggingSingleSubscriber<T> extends java.lang.Object implements SingleSource.Subscriber<T>
ASingleSource.Subscriberthat wraps anotherSingleSource.Subscriber, logging all signals received by theSingleSource.Subscriber, or sent via theCancellable.
-
-
Constructor Summary
Constructors Constructor Description LoggingSingleSubscriber(java.lang.String name, SingleSource.Subscriber<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonError(java.lang.Throwable t)Failed terminal state.voidonSubscribe(Cancellable c)Called when the associatedSingleSourceis subscribed viaSingleSource.subscribe(Subscriber).voidonSuccess(T result)Success terminal state.
-
-
-
Constructor Detail
-
LoggingSingleSubscriber
public LoggingSingleSubscriber(java.lang.String name, SingleSource.Subscriber<T> delegate)- Parameters:
name- the logging name.delegate- theSingleSource.Subscriberto delegate calls to.
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Cancellable c)
Description copied from interface:SingleSource.SubscriberCalled when the associatedSingleSourceis subscribed viaSingleSource.subscribe(Subscriber).- Specified by:
onSubscribein interfaceSingleSource.Subscriber<T>- Parameters:
c- ACancellablethat can be used to cancel the asynchronous computation for this subscriber.
-
onSuccess
public void onSuccess(T result)
Description copied from interface:SingleSource.SubscriberSuccess terminal state.No further events will be sent.
- Specified by:
onSuccessin interfaceSingleSource.Subscriber<T>- Parameters:
result- of theSingleSource.
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:SingleSource.SubscriberFailed terminal state.No further events will be sent.
- Specified by:
onErrorin interfaceSingleSource.Subscriber<T>- Parameters:
t- the throwable signaled.
-
-