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.Subscriber
that 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 aLoggingCompletableSubscriber
that wraps thedelegate
, and uses the specifiedname
for logging.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onComplete()
Success terminal state.void
onError(java.lang.Throwable t)
Failed terminal state.void
onSubscribe(Cancellable c)
Called when the associatedCompletableSource
is subscribed viaCompletableSource.subscribe(Subscriber)
.
-
-
-
Constructor Detail
-
LoggingCompletableSubscriber
public LoggingCompletableSubscriber(java.lang.String name, CompletableSource.Subscriber delegate)
Create aLoggingCompletableSubscriber
that wraps thedelegate
, and uses the specifiedname
for logging.- Parameters:
name
- the logging name.delegate
- theCompletableSource.Subscriber
to delegate calls to.
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Cancellable c)
Description copied from interface:CompletableSource.Subscriber
Called when the associatedCompletableSource
is subscribed viaCompletableSource.subscribe(Subscriber)
.- Specified by:
onSubscribe
in interfaceCompletableSource.Subscriber
- Parameters:
c
- ACancellable
that can be used to cancel the asynchronous computation for this subscriber.
-
onComplete
public void onComplete()
Description copied from interface:CompletableSource.Subscriber
Success terminal state.No further events will be sent.
- Specified by:
onComplete
in interfaceCompletableSource.Subscriber
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:CompletableSource.Subscriber
Failed terminal state.No further events will be sent.
- Specified by:
onError
in interfaceCompletableSource.Subscriber
- Parameters:
t
- the throwable signaled
-
-