Package io.servicetalk.concurrent.api
Class LoggingCompletableSubscriber
- java.lang.Object
-
- io.servicetalk.concurrent.api.LoggingCompletableSubscriber
-
- All Implemented Interfaces:
CompletableSource.Subscriber
public class LoggingCompletableSubscriber extends java.lang.Object implements CompletableSource.Subscriber
ACompletableSource.Subscriberthat wraps anotherCompletableSource.Subscriber, logging all signals received by theCompletableSource.Subscriber, or sent via theCancellable.
-
-
Constructor Summary
Constructors Constructor Description LoggingCompletableSubscriber(java.lang.String name, CompletableSource.Subscriber delegate)Create aLoggingCompletableSubscriberthat wraps thedelegate, and uses the specifiednamefor logging.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonComplete()Success terminal state.voidonError(java.lang.Throwable t)Failed terminal state.voidonSubscribe(Cancellable c)Called when the associatedCompletableSourceis subscribed viaCompletableSource.subscribe(Subscriber).
-
-
-
Constructor Detail
-
LoggingCompletableSubscriber
public LoggingCompletableSubscriber(java.lang.String name, CompletableSource.Subscriber delegate)Create aLoggingCompletableSubscriberthat wraps thedelegate, and uses the specifiednamefor logging.- Parameters:
name- the logging name.delegate- theCompletableSource.Subscriberto delegate calls to.
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Cancellable c)
Description copied from interface:CompletableSource.SubscriberCalled when the associatedCompletableSourceis subscribed viaCompletableSource.subscribe(Subscriber).- Specified by:
onSubscribein interfaceCompletableSource.Subscriber- Parameters:
c- ACancellablethat can be used to cancel the asynchronous computation for this subscriber.
-
onComplete
public void onComplete()
Description copied from interface:CompletableSource.SubscriberSuccess terminal state.No further events will be sent.
- Specified by:
onCompletein interfaceCompletableSource.Subscriber
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:CompletableSource.SubscriberFailed terminal state.No further events will be sent.
- Specified by:
onErrorin interfaceCompletableSource.Subscriber- Parameters:
t- the throwable signaled
-
-