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.Subscriber
that 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 void
onError(java.lang.Throwable t)
Failed terminal state.void
onSubscribe(Cancellable c)
Called when the associatedSingleSource
is subscribed viaSingleSource.subscribe(Subscriber)
.void
onSuccess(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.Subscriber
to delegate calls to.
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Cancellable c)
Description copied from interface:SingleSource.Subscriber
Called when the associatedSingleSource
is subscribed viaSingleSource.subscribe(Subscriber)
.- Specified by:
onSubscribe
in interfaceSingleSource.Subscriber<T>
- Parameters:
c
- ACancellable
that can be used to cancel the asynchronous computation for this subscriber.
-
onSuccess
public void onSuccess(T result)
Description copied from interface:SingleSource.Subscriber
Success terminal state.No further events will be sent.
- Specified by:
onSuccess
in interfaceSingleSource.Subscriber<T>
- Parameters:
result
- of theSingleSource
.
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:SingleSource.Subscriber
Failed terminal state.No further events will be sent.
- Specified by:
onError
in interfaceSingleSource.Subscriber<T>
- Parameters:
t
- the throwable signaled.
-
-